Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Intertrelated controls
Message
De
21/09/2010 09:36:35
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
21/09/2010 08:07:50
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01482058
Message ID:
01482142
Vues:
39
>>>I just stepped through the code. If I change the Age, the breakpoint stops the code showing me that sender is the date control, not the age control. It then runs through the method and changes the age based on the date, then it runs through it with the age control as the sender.
>>
>>Well, sounds like your answer is the event is firing when you are not expecting it to fire. Is your value is getting changed as you expect, but then getting changed back?. Might want to look up what triggers the Text Changed to fire. Is there another event you could use to re-compute the value?
>>Tim
>
>Well, I am kind of expecting it to fire, but not quite in the order it is firing. I would expect it to fire first with the age as the sender, then when the text in the date control gets changed I would expect it to fire again, but this time with the date control as the sender. By my understanding, it should then keep calling itself over and over ad infinitum. So I am definitely not understanding how it works even once. :)
>
>I'm not sure how to tell what is triggering it. I set a breakpoint on the first line and the stack shows nothing besides the code I'm on.
>
>I don't see any other event that I could use.

Personally, since it is a web application, I would put a "Recalculate" button on the form. If I order from Amazon and I change the quantity of some item on my order or the shipping method, I click the "Update" or "Recalculate" button. It is typical and intuitive and would solve your issue. You may want to fire your re-calculate if they submit without re-calculating. Just a thought. Another approach would be to keep track of which field they changed so when the methods fire more than once, you know you already dealt with it and you know which one the user actually changed.
Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform