By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,830 Members | 1,722 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,830 IT Pros & Developers. It's quick & easy.

Maintaining Page State with Panel Control

P: n/a
I'm having a problem maintaining state with a Panel control in a MasterPage
and I need help thinking through this process.
The basic structure of the HTML in the Master looks like this...

<asp:PanelActivatorLinkButton ... />
....
....
<asp:Panel Visible="[true | false]" ...>
<asp:LoadContentLinkButton ... />
<asp:ContentPlaceHolder ... />
</asp:Panel>

At design-time when the Panel's Visible property is set to true in the HTML
and the page is then loaded the Panel is displayed as expected. Thus,
selecting the PanelActivatorLinkButton is not neccessary at this point
because the Panel's Visible property has been set to true before loading the
page. Selecting the LoadContentLinkButton loads the expected content into
the ContentPlaceHolder. The "content" can be a Change Password control for
example.

The Panel should not be displayed at run-time however until the
PanelActivatorLinkButton is selected and code in its click event handler
sets the Panel's Visible property to true. The Panel will display when the
Panel Visible property is set to true using the PanelActivatorLinkButton
event.

Once the Panel has been displayed, selecting the LoadContentLinkButton then
causes the entire Panel to disappear from the page. The
LoadContentLinkButton raises a PostBack. Viewing source shows the Panel has
not generated any HTML source.

It is interesting to note that all controls appear in the control tree when
using Trace. This would include controls such as the Change Password control
that should be displayed when selecting the LoadContentLinkButton.

Now here's the good part: selecting PanelActivatorLinkButton -- again --
will raise another PostBack and the content that was supposed to be
displayed when selecting the LoadContentLinkButton the first time is
displayed and will function as expected.

There is a state issue here I haven't figured out yet. Your comments?

--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
Jun 4 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Resolved.

// Defined a property in the Master for the Panel control
public Panel MembershipControlPanelProperty
{
get { return MembershipControlPanel; }
set { MembershipControlPanel = value; }
}

// Access the property in the content page being called by
LoadContentLinkButton
Master.MembershipControlPanelProperty.Visible = true;

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:OG**************@TK2MSFTNGP02.phx.gbl...
I'm having a problem maintaining state with a Panel control in a
MasterPage and I need help thinking through this process.
The basic structure of the HTML in the Master looks like this...

<asp:PanelActivatorLinkButton ... />
...
...
<asp:Panel Visible="[true | false]" ...>
<asp:LoadContentLinkButton ... />
<asp:ContentPlaceHolder ... />
</asp:Panel>

At design-time when the Panel's Visible property is set to true in the
HTML and the page is then loaded the Panel is displayed as expected. Thus,
selecting the PanelActivatorLinkButton is not neccessary at this point
because the Panel's Visible property has been set to true before loading
the page. Selecting the LoadContentLinkButton loads the expected content
into the ContentPlaceHolder. The "content" can be a Change Password
control for example.

The Panel should not be displayed at run-time however until the
PanelActivatorLinkButton is selected and code in its click event handler
sets the Panel's Visible property to true. The Panel will display when
the Panel Visible property is set to true using the
PanelActivatorLinkButton event.

Once the Panel has been displayed, selecting the LoadContentLinkButton
then causes the entire Panel to disappear from the page. The
LoadContentLinkButton raises a PostBack. Viewing source shows the Panel
has not generated any HTML source.

It is interesting to note that all controls appear in the control tree
when using Trace. This would include controls such as the Change Password
control that should be displayed when selecting the LoadContentLinkButton.

Now here's the good part: selecting PanelActivatorLinkButton -- again --
will raise another PostBack and the content that was supposed to be
displayed when selecting the LoadContentLinkButton the first time is
displayed and will function as expected.

There is a state issue here I haven't figured out yet. Your comments?

--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/

Jun 4 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.