passing values to pages
- by Indranil Mutsuddy
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