By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,934 Members | 1,366 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,934 IT Pros & Developers. It's quick & easy.

custom event handler

P: n/a
I have a user control that displays the contents of a shopping cart. I
want this control to update its contents whenever an item is added to
the cart. Currently, the cart only updates if it is forced to do so
through a page reload or clicking a button within the user control
itself (thereby reloading the user control). I want to raise an event in
the user control whenever an item is added to the cart. This event
should cause the current contents of the cart to be displayed by the
user control. Any ideas? Is a custom event handler the way to go about
this? Are there any good resources on how to do this?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Philip Townsend" <pt*******@v1tech.com> wrote in message
news:ur**************@TK2MSFTNGP12.phx.gbl...
I have a user control that displays the contents of a shopping cart. I
want this control to update its contents whenever an item is added to
the cart. Currently, the cart only updates if it is forced to do so
through a page reload or clicking a button within the user control
itself (thereby reloading the user control). I want to raise an event in
the user control whenever an item is added to the cart. This event
should cause the current contents of the cart to be displayed by the
user control. Any ideas? Is a custom event handler the way to go about
this? Are there any good resources on how to do this?


Eieiii - I'd be careful of this. As much as asp.net seems to be an event
driven environment like desktop VB used to be, it's really just doing clever
tricks with viewstate maintenance, request/post, and some occassional
JavaScript. It would be much better if you could somehow tie the addition of
items to the cart in your cart to the button click events, or whatever is
causing the addition of the item.

I've played with custom event handlers - and that was in a desktop
application (for a calculator number pad.) .NET does not really make this
easy, and I imagine it does not get any easier trying to do it in asp.net.
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.