Rajkumar R

Rajkumar R

  • NA
  • 183
  • 220.1k

Redirecting error in C#

Jan 2 2012 6:02 AM
protected void Print_Data(object sender, EventArgs e)
    {
        string BK_Code = ((ImageButton)sender).CommandName;
        StringBuilder sb = new StringBuilder();
        sb.Append("<Script language='javascript'>");
        sb.Append("var m_Format = showModalDialog('Rpt_BL_Format.aspx','null','dialogHeight:150px,dialogWidth:150px,center:yes');");
        //StringBuilder sb1 = sb;
        //string ddl = sb.Append("m_Format").ToString();
        //sb.Append("if (m_Format == 'DL')");
       // sb.Append("window.open('Rpt_BL_DL.aspx?BK_Code=" + BK_Code + "&SMode=E','childwindow','fullscreen,status=yes, scrollbars=1,TOP=0,LEFT=0,resizable=YES');");
        sb.Append("if (m_Format == 'TTL')");
        sb.Append("window.open('Rpt_BL_BKN_TTL.aspx?BK_Code=" + BK_Code + "&SMode=E&m_Format=TTL','childwindow','fullscreen,status=yes, scrollbars=1,TOP=0,LEFT=0,resizable=YES');");
        sb.Append("</Script>");
        ClientScript.RegisterStartupScript(typeof(string), "Print", sb.ToString());
        sb.Append("if (m_Format == 'GBI')");
        sb.Append("window.open('Rpt_BL_BKN_GBI.aspx?BK_Code=" + BK_Code + "&SMode=E&m_Format=TTL','childwindow','fullscreen,status=yes, scrollbars=1,TOP=0,LEFT=0,resizable=YES');");
        sb.Append("</Script>");
        ClientScript.RegisterStartupScript(typeof(string), "Print", sb.ToString());
        sb.Append("if (m_Format == 'AIC')");
        sb.Append("window.open('Rpt_BL_BKN_AIC.aspx?BK_Code=" + BK_Code + "&SMode=E&m_Format=TTL','childwindow','fullscreen,status=yes, scrollbars=1,TOP=0,LEFT=0,resizable=YES');");
        sb.Append("</Script>");
        ClientScript.RegisterStartupScript(typeof(string), "Print", sb.ToString());
    }
the above code i have used to redirect and print the page. Here the first when m_Format == 'TTL' this only working, remaining GBI and AIC are not redirecting.  This TTL, GBI and AIC are dropdownlist values
post solution for this
Thanks in advance

Answers (1)