calling java script function then C# function after clicking ASP.NET button
<p>I have this serious:</p>

<p>I have ASP.NET page, This page contents Update panel with ASP.NET control.</p>

<p>I have Java script function to do validation so when I click the button I will use onclientclick to call the java function to do the validation and after this one done should call then event click button function from code behind.</p>

<p>I tried vew methods but they did not work for me.</p>

<p>here is sample of my code that after I click the button onclientclick will call the java script function for validation and if the validation is OK should call onclick event.</p>

<p>....................
java script function
........................</p>

<pre><code>    &lt;script type="text/javascript" &gt;

function add(){
 if (tag == trye) {


                         document.getElementById('&lt;%=btnInfor.ClientID%&gt;').click();
                         alert("DataAdded")



                    }
                    else {

                          alert("Requiered Field Missing.")
                        return false;

                     }
}

&lt;/script&gt; 
.....................
ASP.NET button
...................
&lt;asp:Button ID="btnInfor" runat="server" Text="Add Information" Style="position: absolute;
                top: 1659px; left: 433px;" 
                onclientclick="JavaScript: return myAdd()" /&gt;
....................
code behind in C#
......................
 protected void btnInfor_Click(object sender, EventArgs e)
        {    
                \\mycode

}
</code></pre>
