How to use Sessions in web forms?
Submitted by: Administratorprivate void Button1_Click(object sender, System.EventArgs e)
{
//Drag TextBox1 and TextBox2 onto a web form
Session["name"]=TextBox1.Text;
Session["email"]=TextBox2.Text;
Server.Transfer("anotherwebform.aspx");
}
Destination web form
private void Page_Load(object sender, System.EventArgs e)
{
Label1.Text=Session["name"].ToString();
Label2.Text=Session["email"].ToString();
Session.Remove("name");
Session.Remove("email");
}
Submitted by: Administrator
{
//Drag TextBox1 and TextBox2 onto a web form
Session["name"]=TextBox1.Text;
Session["email"]=TextBox2.Text;
Server.Transfer("anotherwebform.aspx");
}
Destination web form
private void Page_Load(object sender, System.EventArgs e)
{
Label1.Text=Session["name"].ToString();
Label2.Text=Session["email"].ToString();
Session.Remove("name");
Session.Remove("email");
}
Submitted by: Administrator
Read Online Web Forms Job Interview Questions And Answers
Top Web Forms Questions
☺ | How to select multiple non-sequential dates at Code-Behind in Microsoft web forms? |
☺ | How to use PreviousPage on web forms? |
☺ | How to use Server.Transfer in dot net? |
☺ | How to disable some dates in Calendar control in web forms? |
☺ | How to upload an image files only in .net web forms? |
Top Dot Net Technologies Categories
☺ | MSF Interview Questions. |
☺ | .Net Architecture Interview Questions. |
☺ | ASP.Net MVC Interview Questions. |
☺ | Entity Framework Interview Questions. |
☺ | C# (Sharp) Programming Language Interview Questions. |