You are on page 1of 1

Session in Asp.Net 1.)Create Page Name "CreateSession.aspx". 2.

)Take Two TextBox (txtname,txtage) one Button and Write following Code on Butt on's Click Event. Session("name") = txtname.Text Session("age") = txtage.Text Response.Redirect("page2.aspx") 3.)To Display Session Data Second Page name "DisplaySession.aspx" 4.)Take two label and Write Following Code on Page's Load Event Label1.Text = Session("name") Label2.Text = Session("age") 5.)Now Run "CreateSession.aspx". 6.)To Remove Session Write Following Code on Button's Click Event Session.Clear() Session.Abandon() 7.)Done

You might also like