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.
I thought it was going to be easy, but its turned into a right nuisance.
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.
dont mind changing the code, (although have to keep using materpages and content sections).
<input type="submit" value="Update" onclick="validate()"/>
<SCRIPT LANGAUGE="JavaScript">
function validate() {
var jname = document.getElementById('MainContent_txtname').value;
if (jname == null) {
alert("Please Enter Name");
}
else {
CallServerMethod();
}
}
function CallServerMethod() {
UpdateClient() //I dont work
}
</SCRIPT>
any ideas? Thanks