Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to reload the page in OnClick method?
Message
From
14/11/2006 10:58:15
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
ASP.NET
Miscellaneous
Thread ID:
01169184
Message ID:
01169495
Views:
7
This message has been marked as a message which has helped to the initial question of the thread.
Dimitry the Cause validation doesn't prevent the form to be submited to the server, what happens is when is set to false it doesn't cause any validation of the form, the page is still submited to the server and the onclick event of the button is run.
Whatr Rick was saying is that if you only want to clear values and nothing more you could create a Client Javascript function and then on the click of the html button call that function so nothing is post to the server.

>>Why not use some client code to do this with JavaScript? It seems all youwant to do is clear some values. Use OnClientClick() and then run a function that clears out the values:
>>
>>
>>function ClearVals()
>>{
>>   document.getElementById('txtName').value = "";
>>   document.getElementById('txtAddress').value = "";
>>}
>>
>>
>>This sidesteps the whole issue of posting back and otherwise submitting values that you do not want changed on the server.
>>
>>+++ Rick ---
>
>First, thank you for your suggestion.
>
>But how is the JavaScript approach different from clearing values in the onclick method of the button that does not post back (property CausesValidation set to false)?
Alexandre Palma
Senior Application Architect
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform