To use the value of a session variable in the class files using c# with ASP.Net use the following statement
direct use of Session collection is not allowed in the .cs files so to achieve the purpose we have to follow the whole path i.e
System.Web.HttpContext.Current.Session["varname"].ToString()
Example:
[code]
System.Web.HttpContext.Current.Session["con1"].ToString()
[/code]
++
Thanks and Regards
Meetu Choudhary
Subscribe to:
Post Comments (Atom)
Subscribe via email
MSDotnetMentor
MSDotnetMentor
My Website
http://msdotnetmentor.com
Author
Blog Archive
-
▼
2009
(53)
-
▼
March
(14)
- Silverlight 3- Beta - released
- Creating Calender Using Java Script
- Blinking Text Using JavaScript
- Use a session variable in the class files in c# AS...
- ASP page with database handling
- Keycodes at a glance
- JavaScript String Replace All
- Type Text in Upper Case using CSS
- No scrollbar on HTML web pages - JavaScript code
- Transparent or Hide Scrollbar
- disable scroll bar
- Show or Hide combobox at Runtime using JavaScript
- Sending Email Through ASP.NET using C#
- Overview of ASP.Net Framework
-
▼
March
(14)
Hi Meetu,
ReplyDeleteThanks for you code, it is working perfectly.
Ramesh Rana
WoOw GoOd
ReplyDeleteby Edison Amirtha Raj.oO
and send example code. edison3143@gmail.com