protected void Button1_Click(object sender, EventArgs e) { int MONTH= Convert.ToInt32((DropDownList1.SelectedItem.Value.ToString())); int YEAR = Convert.ToInt32((DropDownList2.SelectedItem.Value.ToString())); Dispatch d = new Dispatch(MONTH,YEAR); String s=d.run(); TextBox1.Text = s; //Response.Redirect("DISPATCH_SALARY.aspx"); }