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

What is razor? : asp.net mvc

0 Answers  


When is the ViewState available during the page processing cycle ?

6 Answers   Siebel,


Explain about the Class view window?

0 Answers  


How to find the client browser type ?

4 Answers   AQA, Cognizant, Satyam,


What are the best practices to follow to secure connection strings in an ASP.NET web application?

0 Answers   MCN Solutions,


What is authorization in asp.net?

0 Answers  


How can exception be handled with out the use of try catch?

0 Answers  


What is preprocessor in .net? Where it use?

0 Answers  


can we edit records from repeater control

2 Answers  


How do you sign out from forms authentication?

0 Answers   MCN Solutions,


Can we have 2 web config files?

0 Answers  


what are debugging types in .net?

2 Answers   ABC, NIIT,


Categories