PDA

View Full Version : query string help


simpleMel
07-16-2009, 09:48 AM
Hi

how do i pass the label lblSession to Webform1 from Webform2 so that the session can work?

Hello

How do i pass lblSession.Text to Webform1 in a querystring
and how do i retrieve the label?

Webform2
if (Session["Dept"].ToString() == "GM")
{
Response.Redirect("~/Webform1.aspx?ButtonType=SPCL" &" Server.UrlEncode(lblSession.Text.Trim())");
}
else if (Session["Dept"].ToString() == "HR")
{
Response.Redirect("~/Webform1.aspx?ButtonType=SPCL" &" Server.UrlEncode(lblSession.Text.Trim())");
}

Webform1
if (Request.QueryString["ButtonType"].ToString() == "BTN" && Request.QueryString["DeptSession"].ToString() == "GM")
{
Session["Dept"] = "GM";
MultiView1.ActiveViewIndex = 0;
}

scottk
07-16-2009, 10:17 PM
Why don't you post the form fields to the next form instead of using session variables or query strings? What are you trying to do exactly?

simpleMel
07-24-2009, 10:32 AM
Resolved by calling the SPCL Button in Webform1 and pass the session into that button.