Dynamic LinkButton - how to catch the event?

  • Thread starter Robert Warnestam
  • Start date
R

Robert Warnestam

Hi,

I've a page where a show a person with some familymembers. For each
familymember I'm creating a LinkButton, which will update the page and show
him during the postback.
The problem is that the events for the LinkButtons doesn't fire because I'm
not rebuilding them during the Page_Load (which is totally unneccessary).
Is there another way to to do what I want? Some way of bringing me
information about which of the many LinkButtons that where pressed...

Best regard

Robert Warnestam
 
M

Marina

You could look at the __EVENTTARGET form field, which should get generated.
I think it should be set to the ID of the control that was clicked.

But in general, it's doubtful that regenerating the linkbuttons would be so
costly. It might be easier to just rerun that code.
 
R

Robert Warnestam

Thanks for your response,
You could look at the __EVENTTARGET form field, which should get generated.
I think it should be set to the ID of the control that was clicked.

Could you please explain it more - The ID is not neccessary but can I
retrieve CommandName & CommandArgument?
But in general, it's doubtful that regenerating the linkbuttons would be so
costly. It might be easier to just rerun that code.

Regenerating the linkbuttons would need me to make several sql request to
retrieve information about a person and his family - information that I
don't intend to use cause the event will trigger another person to show.
 

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

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top