473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Code not triggering

Hi

On my webform, in design mode when I double click on the button component,
it creates a click sub for me. But when I add code to the click event and
run the web form the code does not seem to be executed. I have verified this
by setting break points. Why would clicking the button not execute the click
sub in this case?

Thanks

Regards
Nov 18 '05 #1
3 1350
Do you have some sort of a validator object on any of the fields? If so and
your validator is triggered, then the code will not work.
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:Ow*************@TK2MSFTNGP11.phx.gbl...
Hi

On my webform, in design mode when I double click on the button component,
it creates a click sub for me. But when I add code to the click event and
run the web form the code does not seem to be executed. I have verified this by setting break points. Why would clicking the button not execute the click sub in this case?

Thanks

Regards

Nov 18 '05 #2
This is a required valuator. What should I do to validate the field and
process the entries if the validation is fine?

Thanks

Regards

"OYTUN ASKIN" <oy*****@verizon.net> wrote in message
news:mtL7d.769$pw4.403@trnddc01...
Do you have some sort of a validator object on any of the fields? If so and your validator is triggered, then the code will not work.
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:Ow*************@TK2MSFTNGP11.phx.gbl...
Hi

On my webform, in design mode when I double click on the button component, it creates a click sub for me. But when I add code to the click event and run the web form the code does not seem to be executed. I have verified

this
by setting break points. Why would clicking the button not execute the

click
sub in this case?

Thanks

Regards


Nov 18 '05 #3
I'm in disagreement with Oytun's reply and wanted to offer my help.

Validators do not block a button's Click event from running. The Click event
is always fired if its correctly setup.

Here's how validators work with buttons:
1. When the CausesValidation property is true (which is the default), it
internally calls Page.Validate() for you.
2. In your Click event, it is your responsibility to check Page.IsValid
before attempting to use the data.

In my experience, here's what causes a Click event not to fire:
1. It is not hooked up correctly.
2. Client-side validators are setup. When you submit, they prevent
submitting for various reasons and you never get a post back. Without a post
back, no server side code runs, including your Click event.
If you think that the page is valid but it does not post back, you may have
a buggy version of ASP.NET's validation. There is a problematic release in
the 1.1 series of releases. I haven't had this problem myself but have seen
many users with it and they have either found a hot fix on
msdn.microsoft.com or removed a hot fix. So it may be due to a particular
hot fix.

To test this, turn off client side validation by setting
EnableClientScript=false on each validator. Now no client-side code will
interfere with post back.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl...
This is a required valuator. What should I do to validate the field and
process the entries if the validation is fine?

Thanks

Regards

"OYTUN ASKIN" <oy*****@verizon.net> wrote in message
news:mtL7d.769$pw4.403@trnddc01...
Do you have some sort of a validator object on any of the fields? If so

and
your validator is triggered, then the code will not work.
"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:Ow*************@TK2MSFTNGP11.phx.gbl...
> Hi
>
> On my webform, in design mode when I double click on the button component, > it creates a click sub for me. But when I add code to the click event and > run the web form the code does not seem to be executed. I have verified

this
> by setting break points. Why would clicking the button not execute the

click
> sub in this case?
>
> Thanks
>
> Regards
>
>



Nov 18 '05 #4

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

Similar topics

2
by: Markus Sons | last post by:
Hello NG, I need some kind of triggering mechanism while capturing audio. I don't need to know the audio data itself, but I need to know, at which point in time the audio level climbs above a...
13
by: Benny | last post by:
Dear All, I need to send a set of Emails from my application (reminders) each month 1st. Is there anyway in ASP scripts to trigger an event to run automatically? I have no dedicated server, so...
13
by: aundro | last post by:
Hello, I've been looking on the web for a solution to this problem: I create a set of checkboxes, and 2 buttons: - one is labeled "All" - the other is labeled "None" Clicking "All" is...
0
by: gustavo_randich | last post by:
Hello, I'm looking for a DB2 workaround on a topic already solved in Oracle: the problem of mutating tables (which states that a trigger action cannot read the triggering table's data). Yes, I...
1
by: OhFiddleSticks | last post by:
Does anyone know if there is a way to add a text value to a combo box (the text box part, not the rowsource) in VBA without triggering an update event? I've tried everything I can think of without...
1
by: Wavemaker | last post by:
I was wondering if there is a way to change the value of a control without triggering an event. The ComboBox control, for example, will trigger the SelectedIndexChanged event when its SelectedIndex...
1
by: Kavvy | last post by:
Hi, I have a form where I want to trigger two events one after the other. eg. tbxDateEntry (text box) has focus and the user clicks on mCal (calendar). At the moment I have...
7
by: christinamasalha | last post by:
hello all, I've been trying to figure this out for days but i don't know what the problem is. I have this form which contains 2 subforms on it. On one of the subforms there is a fields called...
0
by: BillCo | last post by:
I'm a C# Newbie, so if I've missed the obvious here go easy!!! I have a form opened from a MDI parent. The form has a data bound combo box, with a SelectedIndexChanged event (fills a list view...
1
by: raddrummer | last post by:
OK this is a total newbie question but.....I have a field in a subform that I want to use to trigger an event on change(). I'm debugging and am trying to get a message box to fire on change (just to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...

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.