I have a web form that has three textboxes on it. Each textbox will have a different value in it. With that value there are four different reports I want to print out for each different value. If textbox1 has a value of 40 then the report matching 40 will print out. If textbox2 has a value of 50 then the report that matches 50 will print out and so on. When the user clicks the print button the first and original report prints. What did I do wrong in my code to get this error?
protected void ButtonPrint_Click1(object sender, EventArgs e)
{
int iTextBoxValue = Convert.ToInt32(TextBox1.Text);
int iTextBoxValue1 = Convert.ToInt32(TextBox2.Text);
int iTextBoxValue2 = Convert.ToInt32(TextBox3.Text);
int iTextBoxValue3 = Convert.ToInt32(TextBox4.Text);
if (iTextBoxValue > 90)
{
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language=javascript>window.open('ReportFormFTE.aspx','PrintMe','height=650px,width=950px,scrollbars=1');</script>");
}
else if (iTextBoxValue1 < 40)
{
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language=javascript>window.open('ReportFormFTE40.aspx','PrintMe','height=650px,width=950px,scrollbars=1');</script>");
}
else if (iTextBoxValue2 < 50)
{
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language=javascript>window.open('ReportFormFTE50.aspx','PrintMe','height=650px,width=950px,scrollbars=1');</script>");
}
else if (iTextBoxValue3 < 90)
{
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language=javascript>window.open('ReportFormFTE4050.aspx','PrintMe','height=650px,width=950px,scrollbars=1');</script>");
}
}