passing values to pages
Posted
by Indranil Mutsuddy
on Stack Overflow
See other posts from Stack Overflow
or by Indranil Mutsuddy
Published on 2010-05-05T10:19:54Z
Indexed on
2010/05/05
10:28 UTC
Read the original article
Hit count: 342
Hello friends, What i am trying here is to pass values to other pages. When i include the following code
private void Button1_Click(object sender, System.EventArgs e)
{
// Value sent using HttpResponse
Response.Redirect("WebForm5.aspx?Name="+txtName.Text);
}
if (Request.QueryString["Name"]!= null)
Response.write( Request.QueryString["Name"]);
everything works fine the name gets displayed. Now if use MemberId instead, though i can see the Id in the Url, but while checking for Null in other page, its true. Whats wrong??
Now I tried the same thing using session i.e.
Session["MemberId"] = this.TxtEnterMemberId.Text;
if (MemberSex.Equals("M"))
Response.Redirect("PatientDetailsMale.aspx",false );
Page_load event of the other page
if (Session["MemberId"] != null)
mid = Session["MemberId"].ToString();
IT Works..Could u guys explain the behaviour please?
P.S. Can anyone give a breif in layman words about SessionId and its usage.
Thanking you,
Indranil
© Stack Overflow or respective owner