problem with button ASPX (running javascript) since I have added a control validator.

  • Thread starter Thread starter Herve MAILLARD
  • Start date Start date
H

Herve MAILLARD

Hi,

J'ai un bouton ASPX qui doit déclencher un script java.
I have an ASPX button running a javascript.

To do this, I have added in the codebehind :
this.Btn_Debut.Attributes.Add("onclick","javascript:DatePicker('Selection_Ar
chives','Date_Debut')");

So far, no problem with this...

Then, I have added some controls validator. Then the button stop to works.
If I remove the validator, everythings run ok.

Can you help me ?

H. MAILLARD
 
This is because the validator is adding it's own onClick attribute and
overriding your one. You can turn the off the client-side validation by
setting the EnableClientScript property to False.
 
You might want to look at the following articles:

User Input Validation in ASP.NET (ASP.NET Technical Articles)
Review the validation framework in ASP.NET and walk through an example of
adding validation to a page. (11 printed pages)
http://msdn.microsoft.com/library/en-us/dnaspp/html/pdc_userinput.asp

ASP.NET Validation in Depth (ASP.NET Technical Articles)
View a detailed examination of the workings of ASP.NET validation Web
controls. (15 printed pages)
http://msdn.microsoft.com/library/en-us/dnaspp/html/aspplusvalid.asp
 
Back
Top