Click here to Skip to main content
12,830,743 members (42,156 online)
Rate this:
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 6:09am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

private void Button1_Click(object sender, System.EventArgs e)
    // Value sent using HttpResponse

if (Request.QueryString["Name"]!= null)
    Label3.Text = Request.QueryString["Name"];

HttpCookie cName = new HttpCookie("Name");
cName.Value = txtName.Text;
if (Request.Cookies["Name"] != null )
    Label3.Text = Request.Cookies["Name"].Value;

// Session Created
Session["Name"] = txtName.Text;

// 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;

// 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; }


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;
RaisKazi 3-Oct-12 11:16am
Is this a solution to your Question?
Rate this: bad
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 Question is that how can l handle this error

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170326.1 | Last Updated 3 Sep 2014
Copyright © CodeProject, 1999-2017
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