Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there a generally accepted way to pass data from one ASP.Net form to another after validation?
    primarykey
    data
    text
    <p>I have an ASP.Net form (Page1) where the user enters some data and then clicks the submit button. </p> <p>As part of Page1, I have some Validators, including a CustomValidator which needs to do its validation back on the server. </p> <p>When the user clicks the submit button a post is done to Page1 and the validation routine is run on the server and as long as I check Page.IsValid in the button click routine the form knows whether things have passed or not.</p> <p>When the validation doesn't pass everything properly goes back to Form1 and the error message is displayed.</p> <p>When the form does pass validation, I want to pass the data that the user entered to a second form (Page2) so that Page2 can be rendered correctly based on the data the user entered on Page1.</p> <p>Is there a generally accepted way, or best way, to pass the data to Page2? Here are some ways I know about:</p> <ul> <li>Call Page2 with a query string: This won't work as I need the data to not be visible to the user in certain cases.</li> <li>Use the PostBackUrl on the submit button to go to Page2: As far as I know, this won't work correctly because then the server side validation routines for Page1 won't be run.</li> <li>Use Session Variables: I don't know of a particular reason why this would be bad.</li> <li>Use Server.Transfer: I don't really have any experience with this.</li> </ul> <p>I would think that this would be a pretty standard thing to do but I'm having a hard time finding any information on the correct way to do it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload