views:

190

answers:

4
Response.Redirect("Password_ret.aspx?userid="+TextBox1.Text);

sends the data present in the text box to password_ret page

Similarly, What command should I use for

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)

to send the data to the next page. I am using

Response.Redirect("Feedback.aspx?Session_ID=" ??what should be used here??);

Session_ID is a field in my database

A: 

I would suggest storing the session ID in a cookie

pdr
A: 

To store session information you can use the Session object, a Cookie, ViewState, the QueryString or a Hidden Form variable. A quick search on StackOverflow or Google should help you decide which is the best option to suit your needs.

Kane
+1  A: 

Do you want the .NET Session ID?

It's available in the field:

Session.SessionID

If that's what you're after. If you want Session ID's to be passed in the URL instead of using cookies, you may enable it like so, in the web.config:

<sessionstate 
  mode="inproc"
  cookieless="true" 
  timeout="20" 
 />
Noon Silk
A: 

Add

DateKeyNames="SessionID"

to your GridView declaration.

Then in your code behind:

Response.Redirect("Feedback.aspx?Session_ID=" + GridView1.SelectedValue);
Jason Berkan