Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9308895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:44:15+00:00 2026-06-19T00:44:15+00:00

I am working in asp.net webforms. I am collecting user inputs in a form,

  • 0

I am working in asp.net webforms. I am collecting user inputs in a form, say Page1, containing several server controls suchas textboxes, comboboxes and radio buttons. When the user clicks on the save button, a new page, say Page2, will be displayed where all the values entered are displayed for verification. The Page2 is displayed by Server.Transfer(“~/Page2”) method in the button click event of Page1. In Page2, the user entered values are obtained by reading the PreviousPage property as shown below:

var memberData = PreviousPage.dependentData;

The Page2 has a Cancel button. When the user finds some dataentry error and want to go back to Page1, they could click on this button. The Cancel button click event runs the following code at the client side:

if (confirm('Are you sure to leave this page?')) {
                window.history.back(1);
            }

The problem is, when the Page1 is reached, all the user entered values are gone. Please let me know how to architect these two pages so that the values in the previous page (Page1) are retained.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T00:44:16+00:00Added an answer on June 19, 2026 at 12:44 am

    You have to save those values somewhere so that both pages have access to them. Most of the time this is done in a database, but you could also use Session, Cache, or even a Cookie if you wanted.

    Since this is user specific, I suspect Session is your best bet. Create a simple data structure to match your data and save it into session:

    public class UserData{
       public String Name {get; set;}
       public Int32 Age {get; set;}
    }
    

    Then when the user submits the page:

    var userData = new UserData();
    userData.Name = //Get from form;
    userData.Age = //Get from form;
    
    HttpContext.Current.Session["UserData"] = userData;
    

    Then when loading your other page:

    var userData = HttpContext.Current.Session["UserData"] as UserData;
    
    if(userData != null){
       //Do some stuff!
    }
    

    Now… there are caveats with this mind you. For instance, if you are running this on multiple servers behind a load balancer, then you need to make sure you are using sticky sessions, or at least some kind of persistent Session Provider.

    I guess what I am saying is do some homework before just slapping this into your app 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found user controls to be incredibly useful when working with ASP.NET webforms. By
I'm currently working on an ASP.Net WebForms application that allows a user to select
I'm working on an ASP.NET WebForms CMS application, and having a bit of trouble
I recently began working on a large ASP.NET WebForms project. The project was using
Good Morning, I'm working on an ASP.NET 3.5 webforms application and have written the
We have an ASP.NET 2.0 WebForms app that uses MS Ajax 1.0. It's working
I was working(learning) with Data bound controls in ASP.Net and suddenly got the error:
Previous working asp.net webforms app now throws this error: System.MissingMethodException: Method not found The
I've been working in asp.net webforms and I've been making a UserControl that depends
I am working on an ASP.NET webforms page that has the following asp markup

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.