how to determine which serverside Button click in Client Side javascript?
<p>How to determine  which serverside Button click in Client Side javascript?
There are many Buttons in the form.</p>

<pre><code>      function onMyClicked()
      {
        var btn = ??;
        if (btn == 'IDDelete') {
        var result = confirm("........ ");
        if (result){       
        xxxxx
        }
        else close();
        }
        else if(btn=='IDClose'){
        xxxxx
        }

         window.onunload = function (){
         onMyClicked();
   }

    &lt;asp:Button ID="IDDelete" runat="server" Text="Delete" ---&gt;
    &lt;asp:Button ID="IDClose" runat="server" Text="Close" ----&gt;
</code></pre>

<p><strong>EDIT:</strong></p>

<pre><code>var isDirty;
        isDirty = 0;        
        function setDirty() {
            isDirty = 1;
        }        
        function onMyClicked() {
        var btn =???;
        if (btn == 'IDClose') {       
                var sSave;
                if (isDirty == 1) {            
                    sSave = window.returnValue = confirm('------');                    
                    if (window.returnValue == false) closerel();
                    if (sSave == true) {                    
                        document.getElementById('__EVENTTARGET').value = 'IDSave';
                        document.getElementById('__EVENTARGUMENT').value = 'Click';  
                        window.document.form1.submit();                        
                    }
                    else {                                 
                          close();                     
                    }
                }
                else close();
          }            
        }       
 window.onunload = function (){
         onMyClicked();
   }     

&lt;asp:Button ID="IDDelete" runat="server" Text="Delete" &gt;
&lt;asp:Button ID="IDClose" runat="server" Text="Close" &gt;
&lt;asp:Button ID="IDSave" runat="server" Text="Save" &gt;
&lt;asp:Button ID="IDClose" runat="server" Text="Close" &gt;
</code></pre>

<p>How to determinde IDClose click?</p>
