JavaScript call to server side event
<p>So I havent done any ASP.net for awhile, and im trying to call some javascript validation, which works, then I need to call a Code behind event.</p>

<p>I thought it was going to be easy, but its turned into a right nuisance.</p>

<p>All i want to do is check if the text box is empty, if so thow an alert and dont run any service side methods, if its not not empty then run method.</p>

<p>dont mind changing the code, (although have to keep using materpages and content sections).</p>

<pre><code> &lt;input type="submit" value="Update" onclick="validate()"/&gt;
&lt;SCRIPT LANGAUGE="JavaScript"&gt;
       function validate() {

           var jname = document.getElementById('MainContent_txtname').value;

           if (jname == null) {
               alert("Please Enter Name");

           }
           else {
               CallServerMethod();
           }
        }
       function CallServerMethod() {

                UpdateClient() //I dont work
                }
       &lt;/SCRIPT&gt;
</code></pre>

<p>any ideas?
Thanks</p>
