|
Subject:
|
Include in C#
|
|
Posted By:
|
su
|
Post Date:
|
12/11/2006 5:20:13 PM
|
I am using C#.NET, Visual Web Developer and SQL Server 2000.
I would like to set variables per person/session.
I have declared session["User_login"] in my 1st file which is usersecurity.aspx. Using this I have also captured some values from database and stored into session for ex. session["EmpID"], Session["UserType"].
Now I want to use all these results in 2nd page which is orderlist.aspx. How to use it?
Do I have to include this file into my 2nd page? if yes, How to include file and use its result in C#?
|
|
Reply By:
|
woodyz
|
Reply Date:
|
12/13/2006 12:47:04 AM
|
No - for one, thing, there is no such thing as "includes" in this context. You can merely access the session variable via the Session object from any code in your project that has access to the request.
Woody Z http://www.learntoprogramnow.com
|
|
Reply By:
|
gaurav_jain2403
|
Reply Date:
|
12/15/2006 3:59:43 AM
|
Try something like this:
string login = (string)Sesion["User_login"] in the 2nd page i.e. orderlist.aspx
Gaurav
|