Ah, getting it from a user control makes it a little hairier. The cleanest way I know of is for your user control to raise an event when one of its buttons is clicked (might as well call it Click a la the framework). Then register an event handler for MyUserControl.Click in your hosting page. Presuming your user control has multiple link buttons, then in the EventArgs of the event you raise you'll want to identify the particular button that was clicked, along with any other arguments you need to go with it. In the event handler on the page, you'll parse the eventargs and then do whatever you're going to do. If you have other user controls on the page and they need to know about the event, you can register event handlers for them too. If I can add any more detail please let me know. HTH
Bill Bor
----- Andreas Klemt wrote: ----
Hello Bill
thanks for your answer
I am looking for a way how I can see in a Page_Load which LinkButton i
clicke
from other UserControls. Is there a way to see it in Page_Load
Thanks for any help!
Kind Regard
Andrea
Bill Borg said:
I might need more detail behind your question, but in short it depends o where your linkbutton is
need to handle MyDataList.ItemCommand, which gets the click event for al
buttons within that container. If you have multiple buttons, then in tha
event handler you want to check conditionally for which specific button wa
clicked. Easiest way is when you add the linkbutton to the control, set th
CommandName property--i.e. MyButton1, MButton2, etc.--then in your even
handler you can do a case statement on e.item.CommandName to get the button
You can also set CommandArgument, which lets you pass an additional argumen
to your handler when the button is clicked