I want to write code in javascript to valid my textbox at client side in my asp.net application.
I write code javascipt code taking refference from this link
http://www.c-sharpcorner.com/uploadfile/purankaushal/103222006013805am/1.aspx
but when i write code as it is my program it showing error in
Error 4 ; expected c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\master_practice\faf8de5c\f8430d80\App_Web_qiup44vn.0.cs 838 121
Error 9 ; expected c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\master_practice\faf8de5c\f8430d80\App_Web_qiup44vn.0.cs 846 18
like 15 error in App_Web_qiup44vn.0.cs file.
Loading
Dehnert StephenPosted Jul 7, 2012, 12:20 PM
Give a semi colon at the end of the javascript function like
btn.attributes.add("onclick","return javascript:return Validate();");
Try this and before debugging delete all your files from Temoporary Asp.net folder
Thanks
Buy Lace
Santhosh SubramaniamPosted Jul 7, 2012, 7:40 AM
reference u taken is may correct,
but no need to add
btnSubmit.Attributes.Add("onclick", "return validate()")
OnclientClick can call validate() function default when click a button
EG:
this eg accept only numeric values and i call this function in textbox OnKeyDown event