How do you pass session values from one page to another ?

Answer Posted / pravesh chourasia

1.In first page set session variable. e.g.

Session ["Name"] = "Pravesh";

Here "Name" is name of session variable and "Pravesh" is
the value of session variable "Name".

2. In next page get the sesion variable. e.g.:-

string myName=Session["Name"].ToString();

Is This Answer Correct ?    98 Yes 28 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a postback url?

498


Can you edit data in the Repeater control? Which template must you provide, in order to display data in a Repeater control? How can you provide an alternating color scheme in a Repeater control? What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?

559


a)COM Callable Wrapper b)Runtime Callable Which one of the above is Win32 API in .Net?

1599


Describe state management in asp.net?

555


How to set the pane area to transparent of a scrollPane component.?

574






What are the authentication types in asp.net?

577


Describe in brief .net framework and its components.

548


How to count the number of objects present in a web page? How to count the number of radio buttons in a web page?

636


Is asp.net different from asp? If yes, explain how?

501


What are the data controls available in asp.net?

513


Can you explain the importance of finalize method in .net?

596


How can you use a custom controls in ASP.NET application?

552


Is session stored in browser?

536


What are the asp.net 2.0 features?

556


How we implement the multiple paypal value with gridview in my website and how we make a payment through Credit Card.

1429