C
clintonG
// MasterPage
<LinkButton1 />
<Panel1>
<LinkButton2 />
</Panel1>
LinkButtons defined in the MasterPage are being used to simulate tabbed
navigation. When LinkButton1 is clicked, the 'tab' sets Panel1.Visible =
"true" and changes the background color properties of the tab by setting the
LinkButton1.CssClass property. LinkButton2 is then displayed. A content page
is loaded when LinkButton2 is clicked.
When LinkButton2 is clicked -- POOF -- it disappears from the View State and
LinkButton1.CssClass loses background color state so the 'tab' does not
appear as if it had ever been selected.
I've tried strongly typed MasterPage directives with public properties and
I've tried using the FindControl method but could not restore state to
either control. The ViewState remains empty.
Then I learned about the PostBackUrl property which the LinkButton supports
and which is supposed to allow the properties of a control to be passed to
the new content page where we can get or set properties of the control using
a PreviousPage object.
But nooooooo. Not for me.
PreviousPage [1] can get the ID of LinkButton2 and LinkButton2 is now in the
ViewState but is has no Render Size values and I can not get or set any
other properties on LinkButton2; i.e. setting neither the Enabled nor the
Visible property or both will not redisplay the LinktButton2 control as the
Render State value remains 0 (the control is not being rendered as HTML).
I can't even restore the background color state to the LinkButton1 tab [2].
I have two question to ask:
A.) Does anybody have a clue what to do? How do controls disappear from the
ViewState?
B.) Does anybody know how to find a child control such as LinkButton2 when
not using PostBackUrl?
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
[1]
LinkButton tab1 = PreviousPage.Master.FindControl("HeaderTab1") as
LinkButton;
if(tab1 != null)
tab1.CssClass = "HeaderTab";
<LinkButton1 />
<Panel1>
<LinkButton2 />
</Panel1>
LinkButtons defined in the MasterPage are being used to simulate tabbed
navigation. When LinkButton1 is clicked, the 'tab' sets Panel1.Visible =
"true" and changes the background color properties of the tab by setting the
LinkButton1.CssClass property. LinkButton2 is then displayed. A content page
is loaded when LinkButton2 is clicked.
When LinkButton2 is clicked -- POOF -- it disappears from the View State and
LinkButton1.CssClass loses background color state so the 'tab' does not
appear as if it had ever been selected.
I've tried strongly typed MasterPage directives with public properties and
I've tried using the FindControl method but could not restore state to
either control. The ViewState remains empty.
Then I learned about the PostBackUrl property which the LinkButton supports
and which is supposed to allow the properties of a control to be passed to
the new content page where we can get or set properties of the control using
a PreviousPage object.
But nooooooo. Not for me.
PreviousPage [1] can get the ID of LinkButton2 and LinkButton2 is now in the
ViewState but is has no Render Size values and I can not get or set any
other properties on LinkButton2; i.e. setting neither the Enabled nor the
Visible property or both will not redisplay the LinktButton2 control as the
Render State value remains 0 (the control is not being rendered as HTML).
I can't even restore the background color state to the LinkButton1 tab [2].
I have two question to ask:
A.) Does anybody have a clue what to do? How do controls disappear from the
ViewState?
B.) Does anybody know how to find a child control such as LinkButton2 when
not using PostBackUrl?
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
[1]
LinkButton tab1 = PreviousPage.Master.FindControl("HeaderTab1") as
LinkButton;
if(tab1 != null)
tab1.CssClass = "HeaderTab";