Can session variables be accessed from code-behind?

Answers were Sorted based on User's Feedback



Can session variables be accessed from code-behind?..

Answer / swapna

Yes. You can access the "Session" dictionary within a code-
behind file just like you would if you were accessing it
from within an line .aspx file.

For example: Session("Name") = "Scott"

Is This Answer Correct ?    16 Yes 3 No

Can session variables be accessed from code-behind?..

Answer / gggg

" YES "

simply take 2 websites

for example in 1st website..... u have a textbox1

on page load()
--------------
Session["name"]=textBox1.Text;

in 2nd website..........

on page load()
-------------

Response.Write(Session["name"]);



definatly u will get the ans ,, whatever u entering in the
textbox1 in 1st website that will displat in 2nd website

Is This Answer Correct ?    12 Yes 10 No

Post New Answer

More ASP.NET Interview Questions

Explain current thinking around IClonable.

1 Answers   Infosys, Wipro,


Where does the Web page belong in the .NET Framework class hierarchy?

1 Answers   Perot Systems, Visual Soft,


Tell me the code snippet to show how we can return 404 errors from HttpError?

0 Answers  


Hey I am using asp.net mvc architecture. I creating one dropdownlist using <select id="State" name="State"></select> this is dynamic list.Its displaying properly. But in time of Edit.If i load a page dropdownlist is not displaying the item which is stored in table.

1 Answers  


What are client activated objects and server activated objects?

0 Answers  






What is viewstate? What does the "enableviewstate” property do? Whay would I want it on or off?

0 Answers  


Who can consume WebAPI?

0 Answers  


How should I destroy my objects in asp.net?

0 Answers  


What command line used to generate Runtime callable wrapper.

2 Answers   CTS,


how to retrieve property settings from xml .config file.

0 Answers  


What is the name of the base class that all web forms will be inherited?

7 Answers  


Do you support digital rights management to protect my videos?

0 Answers  


Categories