protected void Print_Data(object sender, EventArgs e)
{
string BK_Code = ((ImageButton)sender).CommandName;
StringBuilder sb = new StringBuilder();
sb.Append("");
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("");
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("");
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
Loading
AartiPosted Jan 4, 2012, 6:54 AM
Please try with this code
Yours Code
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("");
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');");
REPLACES WITH this
sb.Append("if (m_Format == 'GBI')");
sb.Append("window.open('Rpt_BL_BKN_GBI.aspx?BK_Code=" + BK_Code + "&SMode=E&m_Format=GBI','childwindow','fullscreen,status=yes, scrollbars=1,TOP=0,LEFT=0,resizable=YES');");
sb.Append("");
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=AIC','childwindow','fullscreen,status=yes, scrollbars=1,TOP=0,LEFT=0,resizable=YES');");