mphillip85
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.
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
J.
Look through your ASPX page's HTML; if the form controls are akin to
<input ... />
try adding a unique id attribute and adding runat="server", or changing them to their ASP.NET equivelents (e.g.
<input type="text" />
becomes
<asp:TextBox />
).J.
ASKER
i am using <input type="text" /> and what can I use on the form to validate before I press the submit?
ASKER
my dropdownlist's , both of them, do not clear only the input boxes clear after the submit has been clicked.
ASKER
how can i just re-populate the input text boxes since I have the data saved in a variable(s).
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
for validation, have a look at these notes: http://www.w3schools.com/aspnet/aspnet_refvalidationcontrols.asp
ASKER
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.
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.
Your best bet is to prevent the error from happening by adding some kind of verification schema.