how to call the codebehind file methods in java script in asp.net2.0?
<p>i can write methods like that </p>

<pre><code>public void CompareEmail()
{
some code
}
public void UpdateEmail()
    {
some code

}
public void InsertEmail()
    {
some code

    }
</code></pre>

<p>i am click the button onclientclick call the function like that</p>

<pre><code> &lt;asp:Button ID="btnSendNow" runat="server" CssClass="invdisp_btn" OnClick="btnSendNow_Click"
                    Text="Send Now" OnClientClick="return getEmailMessage()" /&gt;
</code></pre>

<p>java script function is like that</p>

<pre><code>&lt;script type="text/javascript" language="javascript"&gt;
    function getEmailMessage()
     {
  var LoginID = document.getElementById('hdn').value;\\ i can pass 1 or 0
        if (LoginID != 0)
        {   
        //This place using CompareEmail() method How to write code comapare values not matching ask update confirm box  
        var ans;
        ans = window.confirm('DO u want to update?'); 

            if (ans == true) 
            {
//                      control.UpdateEmail();\\how to call UpdateMethod in .cs file
                alert('updated');

            }
            else {

                return false;
            }
        }
        else {
            var ans;
            ans = window.confirm('DO u want to Insert values?');
            if (ans == true) 
            {
            PageMethods.InsertEmail();\\how to call InsertMethod in .cs file
//            control.InsertEmail();
               alert('Inserted');
            }
            else 
            {
                return false;
            }
        }
    }

&lt;/script&gt;
</code></pre>

<p>how to write the code in java script function call the .cs file methods pls help me </p>

<p>Thank u
hemanth</p>
