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

If you want to write your own dot net language, what steps you will you take care?

0 Answers  


What is viewstate?

6 Answers   Abacus, Microsoft, Sopra,


What is the life cycle of web page?

0 Answers  


what is pagination in asp.net ?

1 Answers   Netsweeper,


How do you do client-side validation in .net? How to disable validator control by client side javascript?

0 Answers  






Explain the difference between codebehind="mycode.aspx.cs" and src="mycode.aspx.cs"?

0 Answers  


How do you relate an aspx page with its code behind Page?

2 Answers   Accenture,


Describe SOA and the tenets of it?

0 Answers   Siebel,


What is jade template engine?

0 Answers  


About friend and Protected friend ?

3 Answers   MMTS,


How can we Validate a Controls in ASP.NET page using JavaScript?

0 Answers   QuestPond,


is it possible to use web site without web server from remote place?

1 Answers   ABC, Mannar Company, Quadrant,


Categories