Link to home
Start Free TrialLog in
Avatar of mphillip85
mphillip85Flag for United States of America

asked on

aspx vb.net fill form data disappears when submit

I have a submit form that has data filled out but if there is an error in one of the fields or incorrect data when the submit button is pressed, all the data in the form disappears.  I would like to re-populate the form data after the submit when the code catches an error so the customer does not have to re-type all the data over again.  Thhis is an ASPX form with a standard submit button not a form submit button being used.
Avatar of phoenixfire425
phoenixfire425
Flag of United States of America image

It sounds like it is doing a post back or is reloading the page after the error happens..

Your best bet is to prevent the error from happening by adding some kind of verification schema.
Sounds like you may have EnablePostback set to false on your Page, Form or Controls.  Or that the form fields you have used are not actually server-side controls.

Look through your ASPX page's HTML; if the form controls are akin to
<input ... />

Open in new window

try adding a unique id attribute and adding runat="server", or changing them to their ASP.NET equivelents (e.g.
<input type="text" />

Open in new window

becomes
<asp:TextBox />

Open in new window

).

J.
Avatar of mphillip85

ASKER

i am using <input type="text" />  and what can I use on the form to validate before I press the submit?
my dropdownlist's , both of them, do not clear only the input boxes clear after the submit has been clicked.
how can i just re-populate the input text boxes since I have the data saved in a variable(s).

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Mlanda T
Mlanda T
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
needed runar="serer" and using a textbox instead of a inputbpx
As a comment I will tell this.
I had a user where everything disapeared when he submitted the form. After some investigation I found the reason. He copied some text from an email and by doing that he got some linefeeds and maybe some other special characters along with the text (I tried to paste it into Notepad and there I could see it) and that made the form data disapear "out in the blue" when submitted.