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

Explain how viewstate is being formed?

542


Define page fragment caching?

528


What is web api vs wcf?

583


Explain about Application and Session Events ?

638


What is difference cookie and session?

528






What are the asp.net list controls and difference between them?

520


What is difference between web api and web services?

537


What are the different properties of server control that exists?

569


Write a code for sending an email from asp.net application.

540


What are session state modes? List some of the important session state modes of asp.net.

537


How to rename a table using sql queries?

572


How to disable disable browser's Back button in asp.net (JavaScript)?

570


Explain Features in ASP.NET

578


Explain the concept of event bubbling in ASP.NET?

584


What is variable and constant in .net programming language?

397