Instead of using Hyperlinks and URL / Response.QueryString() parameters to
pass state around in my app, I am using LinkButtons with a corresponding
command event and command arguments.
This page has LinkButtons in a menu down the left hand side, that when
clicked causes the main content of the page to change. The main content of
the page has linkbuttons as well. I am having trouble with the linkbuttons
in the maincontent area keeping their associated command event wired
together.
The linkbuttons in the left menu get built in the page load of the initial
load and all subsequent postbacks (these work fine).
When a left menu linkbutton is clicked it causes a postback,
Page_Load()
BuildLeftMenu() is run in page_load
I don't run BuildMainContent() in the page_load because I don't have the new
TopicID yet.
MyLinkButton_Command() fires next, where I capture the command argument
which tells me the TopicID which I set as a session var and then call
BuildMainContent()
BuildMainContent() fires which grabs the TopicID from the Session and builds
the maincontent linkbuttons .
The server returns the page to me and the maincontent linkbuttons exist, but
are not wired to their commandevents. Meaning when I click on them nothing
happens.
************************************************** *
Now if I put the BuildMainContent() in the page_load so it builds in the
postback, everything works okay.
My question is, why aren't the commandevents wired to the linkbuttons, when
I have clearly wired them up in the BuildMainContent() method?
Thanks.
TPS.