WebUser Control Usage!

V

Vai2000

Hi All, I have a scenario in which I have created a web user control with 3
linkbuttons on it. Now I am using that control in a webform. The thing is I
want to display certain regions in my webpage depending upon the linkbutton
which was clicked.
Q. How do I identify which linkbutton from the web user control was clicked
on my webform?


TIA
 
R

Rick Strahl [MVP]

The easiest and recommended way is to handle the events that will get fired
to the linkbutton.

If you need to find out which control was the event target you can use
Request.Form["__eventTarget"] to retrieve that information.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog
 
K

Kikoz

Define correspondent events for your control. Fire them when your buttons
are clicked. You page subscribes (listens) to those events and do whatever
it is when it gets event notification. You can also create a class based on
EventArgs class, define any kind of properties your main page might need
from you control and pass an instance of that class as a parameter to the
event. Easy.

Hope it helps.
Kikoz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top