473,386 Members | 1,702 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,386 software developers and data experts.

Bizarro event handler behavior

I'm having problems with an event handler as it handles the fired event.
The symptoms are so bizzare that they are hard to describe.

I step through the code as it runs and I see that the event fires (it's
a timer event) in my class library. In my web app I see control go to
the handler - "yippee" I think. Not so fast.

The handler then steps through each line and appears to be executing
them, but not. For instance, I'll try to change the text attribute of a
label and it won't apply the change to the label. Why? Who the hell
knows, since intellisense tells me as I step through it that it did
change the text attribute to "XYZ", or whatever. Internally the text has
changed, but it won't apply to the label on the screen. Does that make
any sense? Bizarre.

I also tried setting a Session variable, a simple string, in this
handler and that works. It sets a value and later in the program the
value is available to another procedure. Cool.

But if I try to set the label.text to that string in the Session
variable, it just doesn't do it. Not cool. I tried using other
controls, like a textbox and got the same result.

I tried Response.Write and calling a script Alert, and each line seems
to execute without any outward evidence or changes. I am apoplectic
over this - it just makes no sense to me. Anybody with a clue that can
help this poor, lost soul?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
2 872
complete logic error on your part.

while the event fired by timer can change the page controls to its hearts
content, its too late to see the changes in the browser because the page has
already been rendered (that ship has sailed).

if you want to use a timer in your code behind, and have it effect the
rendered page, then you need to do a wait somewhere in the code behind (say
page load) until the timer has fired. of course the waiter better not be too
long, or the page will timeout, or the user will get bored of waiting for
the page to render.

-- bruce (sqlwork.com)

"Paul" <no*****************@msn.com> wrote in message
news:eH**************@TK2MSFTNGP11.phx.gbl...
I'm having problems with an event handler as it handles the fired event.
The symptoms are so bizzare that they are hard to describe.

I step through the code as it runs and I see that the event fires (it's
a timer event) in my class library. In my web app I see control go to
the handler - "yippee" I think. Not so fast.

The handler then steps through each line and appears to be executing
them, but not. For instance, I'll try to change the text attribute of a
label and it won't apply the change to the label. Why? Who the hell
knows, since intellisense tells me as I step through it that it did
change the text attribute to "XYZ", or whatever. Internally the text has
changed, but it won't apply to the label on the screen. Does that make
any sense? Bizarre.

I also tried setting a Session variable, a simple string, in this
handler and that works. It sets a value and later in the program the
value is available to another procedure. Cool.

But if I try to set the label.text to that string in the Session
variable, it just doesn't do it. Not cool. I tried using other
controls, like a textbox and got the same result.

I tried Response.Write and calling a script Alert, and each line seems
to execute without any outward evidence or changes. I am apoplectic
over this - it just makes no sense to me. Anybody with a clue that can
help this poor, lost soul?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2
Bruce, thanks for the explanation. I am having problems transitioning
to web forms, and this is a classic example.

Classic, huh? But thanks, this does help. ~P


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

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

Similar topics

10
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script...
20
by: Xah Lee | last post by:
Sort a List Xah Lee, 200510 In this page, we show how to sort a list in Python & Perl and also discuss some math of sort. To sort a list in Python, use the “sort” method. For example: ...
1
by: Jonathan Yong | last post by:
I observe a very weird behavior when dynamically create web control and bind events to it. Create a C# ASP.NET application, Put a PlaceHolder and Textbox onto the Web form, and try with the 4...
3
by: R Millman | last post by:
under ASP.NET, single stepping in debug mode appears not to stop within event procedures. i.e. 1) Create web page with submit button and event procedure for the click event in the code behind...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
0
by: Demetri | last post by:
I have created a web control that can be rendered as either a linkbutton or a button. It is a ConfirmButton control that allows a developer to force a user to confirm if they intended to click it...
8
by: Csaba Gabor | last post by:
Is there any way in Mozilla/Firefox to add an event listener to all textarea elements? Something along the lines of HTMLTextAreaElement.prototype.onkeydown = function() {alert('mom');} only it...
6
by: Joseph Geretz | last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm adding matching pairs of Toolbar buttons and Menu items. All of the buttons and menu items are wired up to send events to...
0
by: clintonG | last post by:
A Matter of Design: OnCommand or OnClick Event Handler? Attributing a control using OnCommand supports the use of other attibutes such as CommandName and CommandArgument. AFIK OnClick does not....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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...

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.