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 will happen if the server confugration file and the application confugration file have different values for sassion state ASP.NET?

0 Answers   HCL,


How can u sort strings in array where strings are passed to method as arguments.

3 Answers   CTS, Syncfusion,


can we transfer data from one page to another page using viewstate if so how?if not y?

1 Answers   Patni,


What is the difference between <%#%> and <%=%>?

5 Answers   IBS,


What’s the difference between asp.net web forms and asp.net mvc?

0 Answers  


Why viewstate is used in asp.net?

0 Answers  


What is difference between session and cookies?

0 Answers  


What is asp net theme?

0 Answers  


define silverlight and advantages ?

3 Answers   QA,


Explain the use of dataadapter.

0 Answers  


What is ipostback?

0 Answers  


How do you hide the columns?

0 Answers  


Categories