what is the role of session and why do we need session in asp.net please ellaborate

Recommended Answers

All 2 Replies

Please read this article.

Hi,
Temporary stored a value.Threee types session states available in asp.net.
1.Inproc 2.State server 3.Sqlserver.
1.Inproc :- while we are restart the iis by the time stored data was lost.
types:-
1.Session:- Many situation it will help Web developers.Ex.we have a login page having username and password textboxs.whenever end user enter the value (such as username ,passsword).

To stored a value to session
session("userId")=txtusername

How to retrive the session value
dim lstrusername as string
lstrusername =session("userId")

ii.Viewstate:- Maintain a values with in page.
Viewstate("username")=Ramesh
Dim lstrname as string
lstrname=Viewstate("username")

Cheers,
Ramesh.KR

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.