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

Tell about WebService in Asp.Net?

5 Answers   Accenture, CTS,


How can u debug your .net application?

0 Answers  


Do I need to have the latest version of windows media player installed?

0 Answers  


What are the differences between the response.write() and response.output.write()?

0 Answers  


Can we Run the Application without Build

3 Answers   Emphasis,






What is form submit?

0 Answers  


What are triggers of an updatepanel?

0 Answers  


Difference between application events and session events

0 Answers  


Take one textbox if I am inputting abc alphabet in capital letter or in small letter on the button click it will be bcd or if I enter 123 and it would be 234 like that in ASP.NET?

3 Answers   DNS,


How to implement role based security in asp.net mvc? : Asp.Net MVC

0 Answers  


What is microsoft windows sharepoint services?

0 Answers  


What is the relationship(in oops) between codebehind and inline code(.aspx to .aspx.cs)??? explain

4 Answers   Mind Tree,


Categories