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

Which is faster viewdata or viewbag?

0 Answers  


Explain swagger components.

0 Answers  


Explain the differences between managed and unmanaged code?

0 Answers  


Which institute provide good Project training on .Net technologies in hyd?

5 Answers  


I have a datagrid of 10 rows and I am updating the fifth row using template column edit. How wil u know that the row is updated, so that it can be send to database for updating the respective table?

3 Answers  






How to change Master page in ASP.Net using code?

0 Answers   HCL,


What is asp according to you?

0 Answers  


What are cookies in your browser?

0 Answers  


Describe a bubbled event and how it is used ?

0 Answers   Siebel,


What is the function of the CustomValidator? a) It allows for custom C# client-side code to validate entries in a control. b) It allows for a custom mixture of validator controls to use one central control for the display of messages. c) It uses scripted client-side code to validate the entry in a control. d) It uses server-side code to validate the entry in a control.

4 Answers   ABC, Syntax Softtech, TCS,


What is Difference between Production Serves and Development Servers? And Suppose, m adding/deleting C# file in a project based on the Specific Requirement. These Files are Automatically updated in Production Servers? So Which tool is needed to do This One?

0 Answers  


What is use of <% %> in asp.net?

0 Answers  


Categories