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,
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,