473,654 Members | 3,280 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Avoid MasterPage to refresh



I have a MasterPage containing a TreeView menu. When clicking a menu item, a
page is loaded into the ContentPlaceHol der. It seems like both the
MasterPage and the page in the ContentPlaceHol der is refreshed when clicking
the menu item. That might be how it is supposed to be, but the problem is
that the menu in the masterpage returns to it's origin state where all the
nodes are collapsed. Is there a way to avoid this from happening?

TIRislaa


Apr 18 '07 #1
3 3519
Be sure to only refresh/databind the treeview if "not IsPostback"
and
Enable ViewState on the treeview.

Hope this helps
--
Brad

"Software is like melted pudding..."
"Tor Inge Rislaa" wrote:
>

I have a MasterPage containing a TreeView menu. When clicking a menu item, a
page is loaded into the ContentPlaceHol der. It seems like both the
MasterPage and the page in the ContentPlaceHol der is refreshed when clicking
the menu item. That might be how it is supposed to be, but the problem is
that the menu in the masterpage returns to it's origin state where all the
nodes are collapsed. Is there a way to avoid this from happening?

TIRislaa


Apr 18 '07 #2
Thank you
"Brad Roberts" <Br************ *****@hotmail.c omskrev i melding
news:13******** *************** ***********@mic rosoft.com...
Be sure to only refresh/databind the treeview if "not IsPostback"
and
Enable ViewState on the treeview.

Hope this helps
--
Brad

"Software is like melted pudding..."
"Tor Inge Rislaa" wrote:
>>

I have a MasterPage containing a TreeView menu. When clicking a menu
item, a
page is loaded into the ContentPlaceHol der. It seems like both the
MasterPage and the page in the ContentPlaceHol der is refreshed when
clicking
the menu item. That might be how it is supposed to be, but the problem is
that the menu in the masterpage returns to it's origin state where all
the
nodes are collapsed. Is there a way to avoid this from happening?

TIRislaa



Apr 18 '07 #3
"Tor Inge Rislaa" <to************ @rislaa.nowrote in message
news:et******** ******@TK2MSFTN GP02.phx.gbl...
I have a MasterPage containing a TreeView menu. When clicking a menu item,
a page is loaded into the ContentPlaceHol der. It seems like both the
MasterPage and the page in the ContentPlaceHol der is refreshed when
clicking the menu item. That might be how it is supposed to be, but the
problem is that the menu in the masterpage returns to it's origin state
where all the nodes are collapsed. Is there a way to avoid this from
happening?
Brad has already answered your question, but it's important to understand
what MasterPages are or, more importantly, what they're not...

The biggest mistake people make concerning MasterPages is to imagine that
they're somehow the clever ASP.NET equivalent of framesets...

Judging by your phrase "When clicking a menu item, a page is loaded into the
ContentPlaceHol der", I have a feeling that you may be falling into this
trap...

I can assure that when you click on a menu item, a page is absolutely not
loaded into the ContentPlaceHol der - precisely the opposite!

When you click on a menu item which redirects to another page, the entire
page is rendered from the beginning. If the page in question happens to be a
content page, then its MasterPage will be used to provide the "top and tail"
of the eventual HTML which is streamed down to the client browser...

A MasterPage isn't actually a page at all - it's just a special kind of
UserControl.
Apr 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4344
by: Leffe Andersson | last post by:
Hi folks! I have a MasterPage with some public methods, and I would like to call them from a (app_code) class. Is it possible to set a directive or an assembly reference to a MasterPage from a normal class? I have no problem to call the masterpage's methods from a contentpage, but what I would like to do is someting like this... public partial class MyMaster : System.Web.UI.MasterPage
1
1260
by: Shell | last post by:
Hi All, I have a scenario where I have a Master Page for all of my WebPages, and in one of the pages I update a database record, after that I want to refresh this WebPart on Master Page manually. How is this possible? The problem is on Button Click to update record in database, first the Page_Load event will be called and the Master Page gets refreshed, after that the actual updation code happens. Hence the WebPart still shows the...
3
2080
by: Alex Maghen | last post by:
Hi. I'm a little confused about the code that resides in the code-behind of a MasterPage and the code that resides in the code-behind of the actual pages that USE that MasterPage. I'm noticing, for example, that the Page_Load on the specific page executes before the Page_Load of its MasterPage. Is this right? But what I really want to understand is VARIABLE SCOPE, etc. between the two. For example: Is there a way for me to write code...
5
1736
by: Islamegy® | last post by:
In my project i have two master page which i change dynamic in runtime.. The first one with 1 ContentPanel "onepanel.master", the second with 2 contentPanel"twopanel.master".. but when i switch between them it don't work, if the default masterpage is "onepanel.master" and try to change it in runtime, ContentPanel2 which is exist in the loaded masterpage throw exception.. the same happen if the default is "twopanel.master" and switch it...
4
1616
by: cevans | last post by:
Is there a way to load a MasterPage programmatically? Not switch a page's masterpage but to create a MasterPage object that holds a given masterpage. So I know I can do: MasterPage master = new MasterPage(); But there is no way to do something like: MasterPage master = new MasterPage("~/default.master");
7
13030
by: Bon | last post by:
Dear all I create a master page with image buttons on the left-hand side for navigation. When a user clicks the student button, the content (i.e. ContentPlaceholder) in masterpage will be changed from default.aspx to students.aspx. I tried to create a subroutine in MasterPage.master.vb to do it. The code is as following. But, the default.aspx's content is shown in MasterPage even I clicked the student button.
2
9000
by: Frank Milverckowitz | last post by:
Hi, New to .NET... question about Masterpages vs. using Frameset I'm using Visual Studio 2005 and notice that the generated pages are of DTD/Doctype that don't support framesets. To use framesets I will be changing all pages to HTML 4.0 loose.dtd. I have a demand from my boss to use framesets to create a "keep-alive" feature using a parent frame + ajax call on a time interval. (i.e. have the
2
3639
by: nicknack | last post by:
Hello. A little tricky situation: I have a master page. Inside that master page I have A div (With overflow:scroll) that contain an ajax updatePanel. Inside that updatePanel I have a tree. The problem is That if I scroll down the tree and then select a node. The tree jump back to the top. Because I'm inside a masterpage I don't have the "maintainScrollPositionOnPostBack".
5
2250
by: Kevin | last post by:
Hi! Is there anyway to avoid flicking between pages navigation in Asp.Net 2.0, like smartnavigation atribute in asp.net 1.1? Thanks and Regards.
0
8290
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
8815
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
8708
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
8594
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...
0
7307
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5622
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
4149
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...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.