473,545 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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","java script:DatePick er('Selection_A r
chives','Date_D ebut')");

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
Nov 17 '05 #1
2 3349
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 EnableClientScr ipt property to False.
"Herve MAILLARD" <rv********@fre e.fr> wrote in message
news:3f******** *************** @news.free.fr.. .
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","java script:DatePick er('Selection_A r chives','Date_D ebut')");

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


Nov 17 '05 #2
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..._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...pplusvalid.asp

--
John Saunders
Internet Engineer
jo***********@s urfcontrol.com
"Herve MAILLARD" <rv********@fre e.fr> wrote in message
news:3f******** *************** @news.free.fr.. .
Hi,

I have set all the controls validator EnableClientScr ipt property to False. but it's still not running.

So strange...
H. MAILLARD

"Herve MAILLARD" <rv********@fre e.fr> a écrit dans le message de news:
3f************* **********@news .free.fr...
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","java script:DatePick er('Selection_A r
chives','Date_D ebut')");

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


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1872
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I have run into is that the emitted html at the end of the process is slightly different and doesn't work. Please don't be put off by all the source...
6
2710
by: Shamin | last post by:
Hi, Thanks in advance for answering to my Question. I'm stuck with this problem and would really appreciate any help. I have 2 aspx files (Main.aspx and ReportViewer.aspx). Main.aspx has a datagrid which is populated with list of report names. When the user click on the name of a report, I display a panel that has a button which on...
4
1404
by: Alphonse Giambrone | last post by:
I have a simple login page that has two text boxes, two requiredfieldvalidators, a couple of labels and a button. It has been reduced down to almost nothing to troubleshoot the below problem. Added to a project on development machine (Win XP Pro, IIS 5.1, CLR 1.1.4322), works fine. Deployed to a shared web host (IIS 5.1, CLR 1.1.4322),...
2
11601
by: Niclas Lindblom | last post by:
Hi, I have a datagrid with linkbuttons. I would like to catch the click event when a link button has been clicked and use the string from the text value of the link button in a clientside Java script. Is this possible or should I look for other ways of achieving this ? Regards Niclas
2
2095
by: Wysiwyg | last post by:
I'm going back to a previous asp.net (C#) web project after a few months of inactivity and my first form, the login, won't submit. I ran with the debugger and still can't see how to resolve this. I am developing with VS2003 and on Windows 2000 Server and have all of the service packs for .NET and Windows. The application is running on an...
2
1184
by: B. Chernick | last post by:
I have an odd problem with validation and I'm not sure if the problem's in ASP, VB, Javascript, or a third-party component. We created a user control (ASP1.1) that encapsulates a third party control (a Telerik RadComboBox). It's really just a Yes/No option box. However due to the Look & Feel of our application, the powers-that-be have...
4
1206
by: Alan Silver | last post by:
Hello, If you add (say) two text boxes to a form, then add a validator with some simple rule for one of them, you can observer the following problem:- Type some erroneous value in the text box with the validator, then click on the other text box. This makes the validator's red error message appear. Now, change the invalid text to...
9
2755
by: Neo Geshel | last post by:
I have strip-mined, strip-searched, and completely exhausted the Internet (up to the 30th page on Google, with 100 results per page!!), all without finding an answer to my question AS TO WHY IT IS IMPOSSIBLE TO PROGRAMMATICALLY ADD A BUTTON TO A DYNAMICALLY CREATED PAGE. Or, to be more precise, why it is impossible to have an onClick sub ...
1
4104
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET framework 1.1). The application implements a Progress Bar webcontrol, that pops up in a window, using the HttpHandler interface, on the event of a button...
0
7468
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7423
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7757
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5329
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.