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

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
 
P

Philip Q [MVP]

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.
 
J

John Saunders

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top