I have a web form that has a print button on it. The print button prints out a report from CRV. Right now the print button works fine for one report. I am trying to get it to print out a different report if the value in the textbox1 is a different number. Here is the code I have.
protected void ButtonPrint_Click1(object sender, EventArgs e)
{
if (TextBox1.Text.Trim().Length > 0)
{
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language=javascript>window.open('ReportFormFTE.aspx','PrintMe','height=650px,width=950px,scrollbars=1');</script>");
}
else if (TextBoxFTE40.Text.Trim().Length < 40)
{
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language=javascript>window.open('ReportFormFTE40.aspx','PrintMe','height=650px,width=950px,scrollbars=1');</script>");
}
else if (TextBoxHC50.Text.Trim().Length < 50)
{
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language=javascript>window.open('ReportFormFTE50.aspx','PrintMe','height=650px,width=950px,scrollbars=1');</script>");
}
else if (TextBoxFTE4050.Text.Trim().Length < 40)
{
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language=javascript>window.open('ReportFormFTE4050.aspx','PrintMe','height=650px,width=950px,scrollbars=1');</script>");
}
}
If the textbox has a value of 40 or more the report that matches 40 will print and the same with the rest. What is the best way to get the code to get the value of textbox1, textbox2, or textbox3 for the right report?