Session State in asp.net
Introduction:
Hai friends , here I will explain you about the session state in asp.net with c# example.
Description:
As in my previous post I have explained about the query string http://aspfunlearning.blogspot.in/2013/11/aspnet-query-string.html, as I am working in c# programming all my examples I am working out here are with c# programming and VS2010 and sqlserver 2008.
About Session State:
The session allowed us to get the value or information from one page to the other page and also it support for objects, for example if we log in to a mail website the input we given in login page (user name) will be display in all the pages.
The session id will be generated each time we log in to that website and it expires when we leave that application or site.
See the samples shown here,
Here, on default page I have created one text box and one button of asp control.
On this second page I have created one label to receive the session value..
In the above image, on Default.aspx.cs coding page on button click event, I am assigning the textbox value to the session .
In the above image, on Page2.aspx.cs coding page I am retrieving the session value as string and assigning it to label.text
Thanks for visiting my page, if you like my post like in google+ and fb like, thanks!
Introduction:
Hai friends , here I will explain you about the session state in asp.net with c# example.
Description:
As in my previous post I have explained about the query string http://aspfunlearning.blogspot.in/2013/11/aspnet-query-string.html, as I am working in c# programming all my examples I am working out here are with c# programming and VS2010 and sqlserver 2008.
About Session State:
The session allowed us to get the value or information from one page to the other page and also it support for objects, for example if we log in to a mail website the input we given in login page (user name) will be display in all the pages.
The session id will be generated each time we log in to that website and it expires when we leave that application or site.
See the samples shown here,
Here, on default page I have created one text box and one button of asp control.
In the above image, on Default.aspx.cs coding page on button click event, I am assigning the textbox value to the session .
In the above image, on Page2.aspx.cs coding page I am retrieving the session value as string and assigning it to label.text
Thanks for visiting my page, if you like my post like in google+ and fb like, thanks!
No comments:
Post a Comment