This is a mirror of official site: http://jasper-net.blogspot.com/

How To Find Which Control Raised PostBack

| Sunday, April 3, 2011
There are times in asp.net when I really want to know which control in the page raised caused the page to post back. An easy way to find this is to register an event with the control that raises PostBack and cast the sender property to the appropriate control as shown below.

image_thumb.png
image_thumb_1.png

As shown in the above code I am casting the sender property to the appropriate control to find out which control raised the PostBack.  Although finding which control raised the event from the click event handler is nice, but sometimes that is too late in the page life cycle. In a scenario where you have to create controls dynamically, you cannot create controls no later than page load event . In this case, it becomes mandatory for you to know which control raised the PostBack and depending on the situation you may decide to perform certain action. The code shown below shows you how to find which control raised PostBack in page load or earlier events.

Read more: Zeeshan Hirani

Posted via email from Jasper-net

1 comments:

Anonymous said...

This is done using techniques such as hydrotherapy, remedial exercise,
Mississauga style massage, rhythmic mobilizations, laser therapy
and myofascial therapy. It is important to understand all of the
different elements that go into interviewing for a massage position,
and know which questions to ask before you
get hired. They also require cardiac and physical rehabilitation.
Feel free to surf my homepage ... anti depression diet pills