<p>I have an asp.net server control (with the asp: in its definition). The button has been set to do post back.</p>

<p>On the server side, I have the on click event handler
e.g btnSave_click()</p>

<p>On the client side, I have a javascript function to be invoked on the click event
e.g btnSave.Attributes.Add("onclick","javascript: return CheckIsDirty();")</p>

<p>Am not sure which order these two will be executed. Because I want first on the client side to warn of any data entry fields that are not yet filled-out before actually saving any data.</p>

<p>Any help?</p>

First client side, second server-side.
So you can use it.
I also use it in some cases, like:
```
```
close.Attributes["OnClick"] = "return confirm('Are you sure?')";
```
```
In this case if the user presses 'No' then the server-side event handler does not even play a role.