protected void Button1_Click(object sender, EventArgs e)
{
//Store Student Class in View State
student _objStudent = new student();
_objStudent.AddStudent(int.Parse(TextBox1.Text.ToString()), TextBox2.Text.ToString());
ViewState["StudentObject"] = _objStudent;
TextBox1.Text = "";
TextBox2.Text = "";
}
protected void Button2_Click(object sender, EventArgs e)
{
student _objStudent;
_objStudent = (student)ViewState["StudentObject"];
TextBox1.Text = _objStudent.Roll.ToString();
TextBox2.Text = _objStudent.Name.ToString();
}