Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
there is Context.Handler object for state management...which is used to transferring data from one page to second page i have problem i just take three form one first page(_default) there is one textbox and one button i has done data transferring from _default to default2 page and i just want to move from default2 to default3 without using context.hadler that can be posible but problem is here when ever im returning from default3 to default2 that show exception in context.handler object so how i can handle this
Posted 3-Oct-12 5:09am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Response.Redirect("WebForm5.aspx",false);
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)
    Label3.Text = Request.QueryString["Name"];
HttpCookie cName = new HttpCookie("Name");
cName.Value = txtName.Text;
Response.Cookies.Add(cName);
Response.Redirect("WebForm5.aspx");
if (Request.Cookies["Name"] != null )
    Label3.Text = Request.Cookies["Name"].Value;
// Session Created
Session["Name"] = txtName.Text;
Response.Redirect("WebForm5.aspx");
 
// The code below shows how to get the session value.
// This code must be placed in other page.
if(Session["Name"] != null)
    Label3.Text = Session["Name"].ToString();
 
// This sets the value of the Application Variable
Application["Name"] = txtName.Text;
Response.Redirect("WebForm5.aspx");
 
// This is how we retrieve the value of the Application Variable
if( Application["Name"] != null )
    Label3.Text = Application["Name"].ToString();
 
public string GetName
{
    get { return txtName.Text; }
}
Server.Transfer("WebForm5.aspx");
 
WebForm4 w;
 
// Gets the Page.Context which is Associated with this page
w = (WebForm4)Context.Handler;
// Assign the Label control with the property "GetName" which returns string
Label3.Text = w.GetName;
  Permalink  
Comments
RaisKazi at 3-Oct-12 11:16am
   
Is this a solution to your Question?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

no i am doing this code it's run well but when i am come back page3 to page2 its generate an error..............my Question is that how can l handle this error
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 447
1 CPallini 355
2 OriginalGriff 245
3 George Jonsson 159
4 Abdul Samad KP 135
0 OriginalGriff 6,344
1 Sergey Alexandrovich Kryukov 5,860
2 CPallini 5,125
3 George Jonsson 3,559
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 3 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100