PreRender AddHandler?

G

Guest

Hello All:

Can I wire server control events in the page's PreRender event and have them
take effect?

I am rendering LinkButtons in a Table on a webform and am using AddHandler
to wire each LinkButton's click event to a private method in the page. The
AddHandler calls are:

AddHandler nameLink.Click, New System.EventHandler(AddressOf HandleLinkClick)
AddHandler numberLink.Click, New System.EventHandler(AddressOf
HandleLinkClick)

where nameLink and numberLink are the names of one of the LinkButtons.

Both LinkButtons appear in each row of the table and each has its
CommandArguement property set to either "Name" or "Number." During PostBack,
I will use HandleLinkClick to determine which LinkButton (either name or
number) was clicked and then rebuild the table based on this choice.

If I run this code in the Page's Load event, HandleLinkClick is called (i.e.
I can get to the CommandArguement property) but it is called after the table
is built; if I run the code in the PreRender event, HandleLinkClick is not
called at all.

Any feedback would be appreciated.

TIA,
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top