473,837 Members | 1,450 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Maintaining Page State with Panel Control

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:PanelActiv atorLinkButton ... />
....
....
<asp:Panel Visible="[true | false]" ...>
<asp:LoadConten tLinkButton ... />
<asp:ContentPla ceHolder ... />
</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 PanelActivatorL inkButton is not neccessary at this point
because the Panel's Visible property has been set to true before loading the
page. Selecting the LoadContentLink Button loads the expected content into
the ContentPlaceHol der. The "content" can be a Change Password control for
example.

The Panel should not be displayed at run-time however until the
PanelActivatorL inkButton 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 PanelActivatorL inkButton
event.

Once the Panel has been displayed, selecting the LoadContentLink Button then
causes the entire Panel to disappear from the page. The
LoadContentLink Button 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 LoadContentLink Button.

Now here's the good part: selecting PanelActivatorL inkButton -- again --
will raise another PostBack and the content that was supposed to be
displayed when selecting the LoadContentLink Button 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
1 2155
Resolved.

// Defined a property in the Master for the Panel control
public Panel MembershipContr olPanelProperty
{
get { return MembershipContr olPanel; }
set { MembershipContr olPanel = value; }
}

// Access the property in the content page being called by
LoadContentLink Button
Master.Membersh ipControlPanelP roperty.Visible = true;

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

"clintonG" <cs*********@RE MOVETHISTEXTmet romilwaukee.com > wrote in message
news:OG******** ******@TK2MSFTN GP02.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:PanelActiv atorLinkButton ... />
...
...
<asp:Panel Visible="[true | false]" ...>
<asp:LoadConten tLinkButton ... />
<asp:ContentPla ceHolder ... />
</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 PanelActivatorL inkButton is not neccessary at this point
because the Panel's Visible property has been set to true before loading
the page. Selecting the LoadContentLink Button loads the expected content
into the ContentPlaceHol der. The "content" can be a Change Password
control for example.

The Panel should not be displayed at run-time however until the
PanelActivatorL inkButton 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
PanelActivatorL inkButton event.

Once the Panel has been displayed, selecting the LoadContentLink Button
then causes the entire Panel to disappear from the page. The
LoadContentLink Button 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 LoadContentLink Button.

Now here's the good part: selecting PanelActivatorL inkButton -- again --
will raise another PostBack and the content that was supposed to be
displayed when selecting the LoadContentLink Button 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1833
by: Das | last post by:
Hi all, I'm using Asp.net. Within a form I have declared declared a public variable. When the form is loaded I set the property for the variable. but it doesn't maintain its state on postback. I there any way to maintain the state for variable? Thanks, Das
0
1363
by: Earl Teigrob | last post by:
I have a page that reads values from an XML file to display to the user. The page also has a control panel that allows administrators to update the XML file with new values. When an administrator presses the update button in the control panel area of the page and the values are written to the XML file, I want the page to reload with the new values WHILE RETAINING ANY VIEW STATE VALUES. (that are not rewriten by the new XML values) I have...
4
1810
by: Bill Smith | last post by:
I have a ASP webpage that creates user accounts. It currently use the format as follows. First Page: Input boxes that get Firstname and Lastname and Department etc. JavaScript Validation If correct posts information to Second Page Second Page: Makes a username, email address and displayname from given info then checks
1
1925
by: Novice | last post by:
Hey all, I have finally managed to create a Custom WebControl and am using a technique from another programmer to maintain state between pages - I would just like to validate this idea. Basically I have created a Custom Web Control that is capable of generating multiple webpages. It actually only creates one webpage, but hides Panels (that contain the web controls - TextBox's, Labels, etc) to give the impression that the user is...
2
1569
by: P. Gruenhagen | last post by:
I've written several UserControls that contain different versions of a form that users need to fill out. Depending on which role a user is logged in as, I load the appropriate UserControl and add it to a panel on my WebForm. So far, so good. However, when the form is posted back to the server, I'm getting stuck. I don't think I want to load the control into the panel again because then all of the values that were set by the user before...
2
1063
by: Larry Charlton | last post by:
Is there a way to arbitrarily persist and restore a page state? For instance: I'm half way through filling out a page and I come accross a field that I don't know which value should be placed in it. What I'd like to do is have a lookup button. In the code for the button click event, I'd like to persist all the information on the form (say to a database or file), redirect to another page passing a persistence ticket. The "called page"...
3
1880
by: velu | last post by:
How to Pass Panel visibility property to other page? I have a scenario here. I have created a user control that has a button and panel visible set to false. When I click the button if the panel.visible = false then panel.visiable = true else panel.visiable = false
0
1321
by: mark.norgate | last post by:
Hi I'm having a problem in adding controls to a page programmatically in response to a button click. Composite user controls added programmatically in the CreateChildControls() method work fine; they maintain their state as expected. Cool and groovy. However, since CreateChildControls() is called before the method that responds to the button click, say AddControl_Click(), for some reason, this control does not maintain its
7
2156
by: Nathan Sokalski | last post by:
I have a page which I dynamically add several usercontrols (*.ascx files) to using the following code: Public Sub Refresh() For Each section As DataRow In Me.GetSections().Rows CType(Me.FindControl("admin" & CStr(section("buttontext")).Replace(" ", "")), adminsection2).RefreshSection() Next End Sub
0
9842
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9682
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10874
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10566
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10271
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7806
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7000
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5668
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.