Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I going back?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00821939
Message ID:
00824112
Vues:
21
Rick,

Which approach did you try? If you are posting back to the same page to perform the validation then you will have the data that was entered by the client. If the validation fails you need to set the corresponding form input values with the data.

Mike


>Mike,
>I just tried what I think you mean, and when my page comes back up the input fields are empty...the data is gone.
>
>Do I need to pass the data along via session variables or query line or what do I need to do to not lose the data?
>
>Rick
>------------------------------------
>>>I have a form collecting data from the user.
>>>When they click submit I go to a server side validation.
>>>If the validation fails I want to go back to the page the user was entering data on...
>>>
>>>How do I get back there?
>>>...to the page with the data, not to a page with an empty form.
>>>
>>>TIA,
>>>Rick
>>
>>Typically in the past I designed my pages to post back to themselves when server side page validation was required. If the validation passed I issued a server transfer to the next page. If it failed the page was sent back to the client with the submitted data filled in plus any validation error messages. This is also a typical approach used in ASP.NET.
>>
>>You could also do this by returning some javascript to the client that issues a history back command. You could also issue an alert dialog to inform the client of the error. I do not recommend this approach since it could fail to execute on some client browsers. You would basicly send code like:
>>
>>
>><html>
>><head>
>><script language="javascript">
>>function doc_init()
>>{
>>   alert("Your error message");
>>   document.history.go(-1);
>>}
>></script>
>></head>
>><body onload="doc_init();">
>></body>
>></html>
>>
Michael McLain
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform