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 difference between URL and URI?

0 Answers   MCN Solutions,


Do gac'ed assemblies have fulltrust?

0 Answers  


Can you explain what inheritance is and an example of when you might use it?

1 Answers   Sports Interactive,


What is inproc mode in session?

0 Answers  


if i want to give an alert message like "try after sometime" to a web page which is being seen by other person.if a web page is not seen by anyone then it should display otherwise it show a display a message stating that other person is viewing so try after some time........how can i implement this.

0 Answers   Siemens,






What is ispostback property?

0 Answers  


What is _viewstart?

0 Answers  


What is state management techniques in asp.net?

0 Answers  


For Web services where you can browse on the Internet?

1 Answers   Siebel,


hi i am varinder. i am very eager to learn ASP.net in C#. i am beginer to it. i have refer some books but i found it tuff to understand. their language is tuff. So please tell me the best site or best book to learn ASP.net in C#. i will be very thankful. Varinder

1 Answers  


How can you execute stored procedure from windows application?

1 Answers   Microsoft,


What is role manager work in web.config? how to restrict perticular pages from the users using the role manager?

1 Answers   Infosys,


Categories