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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / hari

Get the value from Login Page where the Session Iniciated Like

Sesstion["UserID"]

and you may use this value on another page

Like

EnteredBy=Convert.Toint64(Session["UserID"])

Is This Answer Correct ?    0 Yes 3 No

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

Answer / vimal chauhan

response.redirect("requireform.aspx?"& txtbox1.text)

Is This Answer Correct ?    5 Yes 15 No

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

Answer / raja mohamed

request query:
response.redirect("requireform.aspx"?get=txtbox1.text);

requireform.aspx
txtbox2.text=get


server transfer:

dim my as string
m="value"
server.transfer("requireform.aspx"?get=m)
requireform:
dim t as string
t=page.request("m")

Is This Answer Correct ?    11 Yes 34 No

Post New Answer

More ASP.NET Interview Questions

What is page request in asp.net?

0 Answers  


What data type does the Range Validator control support?

5 Answers  


Your ASP.NET application displays sales data on a page. You want to improve performance by holding the page in memory on the server for one hour. You want to ensure that the page is flushed from memory after one hour, and that the page is re-created when the next request for the page is received. What should you do? A . Initialize a new instance of the Cache class in the Application.Start event handler. B . Initialize a new instance of the Timer class in the Page.Load event handler. C . Set the Duration attribute of the OutputCache directive in the page. D . In the Web.config file, set the timeout attribute of the sessionState element.

5 Answers   ADITI, Syntax Softtech,


What is view state? where it stored? can we disable it ?

1 Answers  


difference between gridview,data list and repeater control

7 Answers   ABC, Olive Tech,






I am having four text boxes in my web application. I am setting Required Field validator to each Text box. And I am having two buttons in my application. If i clicked the first button only first two text box validation will get fire. Dont show error message for remaining two text box. If i clicked second button last two text box validation will get fired. It will not consider the first two validation controls. That is how to enable and disable the validation controls.

4 Answers  


How do you make your site SSL enabled ?

3 Answers   Satyam,


What is session authentication?

0 Answers  


Can you explain page lifecycle in net?

0 Answers  


What is the advantage of mvc over asp.net? : Asp.Net MVC

0 Answers  


Explain the benefits of viewstate?

0 Answers  


Can I recieve both html markup for page and code in the asp.net web page's source code portion in the web browser?

0 Answers  


Categories