javascript - Asp.Net CustomValidator is not generating equal functions in java script -


i working on registration page of asp.net website. when use server side asp.net built-in validation controls, work both on client side (by generating appropriate java script code) , offer server side protection too. if circumvent java script, still page has validated on server. using own asp.net c# functions in custom validators job these works on server side. mean equal java script not automatically generated on web form. default behavior of asp.net or missing anything? have write client side java script on myself when use asp.net custom validators?

my 2nd question when write function our asp.net custom validator. called when page submitted server. can access such function java script, start working before page submitted server.

for custom validator have write own validation code in both javascript , c#

if attach javascript validator fire along standard .net validators on page, errors can caught before postback

you need make sure clientvalidationfunction method set.

<asp:customvalidator       id="programmaticid"       controltovalidate="programmatic id of server control validate"      clientvalidationfunction="clientvalidateid"      onservervalidate="servervalidateid"      errormessage="message display in validationsummary control"      text="message display in control"       forecolor="value"       backcolor="value"        runat="server" > </asp:customvalidator> 

Comments