OK I made the HTML RESET Button an HTML Server Control.
I then added the following code:
Private Sub btnReset_ServerClick(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnReset.ServerClick
txtStoreName.Value = ""
txtCity.Value = ""
txtPostalCode.Value = ""
txtStreet.Value = ""
txtPhone.Value = ""
txtAreaCode.Value = ""
End Sub
I stepped thru this in debug mode and the
btnReset.ServerClick method does not fire.
I will try it with a web control button and see if that
works.
Any suggestions or ideas?
>-----Original Message-----
>It doesn't work because HTML Reset buttons reset the
controls in a form back
>to the value they were when the page first loaded. When
you post back, the
>ASP.NET engine sets the values of the controls again, so
the Reset would do
>nothing more than change the controls back to what they
were when you loaded
>the page after the postback.
>
>The only solution to this is to either do it client-side
with javascript or
>server-side on a postback. Just iterate through all of
your controls and set
>their properties appropriately.
>
>
>"Chris Lane" <> wrote in message
>news:027101c3ad3a$24a41f70$...
>> Hi,
>>
>> I have an HTML RESET button and Web Control Button that
>> posts back to the server. Problem is the reset button
>> doesn't work after the postback occurs. Any ideas or
>> suggestions as to why this happens or how I can work
>> around this?
>>
>> Thanks
>
>
>.
>
|