Refresh master page from content page only once

 Hi,

     I have created one Website with master and content page.In Master page i have tree view which fill with the employee name.i want that when i click the save button of content page the new saved entry is display in the tree view along with the previous entry if tree view.

Please Any body help me,

Thanks in advance.


0
hiral
2/5/2009 6:35:07 AM
asp.net.web-forms 93655 articles. 5 followers. Follow

10 Replies
2838 Views

Similar Articles

[PageSpeed] 49

Hi hiral shah ,

Every time you save information from content page, the master page will reload, so the treeview must display the latest data in the treeview. What is the problem with it? Have you got any odd with it? Please give the detail.

Hope this helps. Please feel free to ask if any problem persists or if any help is required. Thanks.


Lets always remember to mark the post that helps us as "Mark as Answer".
A .NET Programmer's Experiences
0
sangam100
2/5/2009 7:02:13 AM

 Hi sangam100,

        I am using ajax so my master page is not refresh every time.

0
hiral
2/5/2009 7:54:45 AM

Hi hiral shah,

Then you can do one thing. Put the master page treeview in updatepanel. Access this updatepanel from child page, when data from child page is updated. Now you can update the update panel in the master page from this chil page. Please look at this page: http://hpc-consulting.ro/csb/blogs/cosmin/archive/2009/01/06/accessing-a-master-page-control-from-an-asp-net-child-page.aspx

Hope this helps. Please feel free to ask if any problem persists or if any help is required. Thanks.


Lets always remember to mark the post that helps us as "Mark as Answer".
A .NET Programmer's Experiences
0
sangam100
2/5/2009 2:11:15 PM

hi sangam100,

      Thanks for reply, i have visit to that link that u provide to me but i enable to understand how that help me if you think that it helps me then pls brief that how can i overcome with problem.and i have tried when my save button is click then i call the method of master page from which i fill the treeview but it can't solve my problem i think it's some reference problem.

0
hiral
2/6/2009 8:33:41 AM

Hi hiral shah ,

You can follow the example below:

1    //this is a method in masterpage that populates my treeview
2        public void PopulateTreeView()
3        {
4            //my code to populate treeview
5        }
6   
7    //this is the button click event handler in child page
8        protected void btnTest_Click(object sender, EventArgs e)
9        {
10           ((MasterPage)this.Master).PopulateTreeView();
11       }

Here MasterPage (bold in code) is the name of the MasterPage.
Hope this helps. Please feel free to ask if any problem persists or if any help is required. Thanks.
 
Lets always remember to mark the post that helps us as "Mark as Answer".
A .NET Programmer's Experiences
0
sangam100
2/6/2009 10:49:02 AM

 Hi hiral,

You can make a public method for populating treeview and then call this method on Submit button click event.


Please mark it as answer if this post seems to be useful.
0
nishit_123
2/6/2009 11:09:04 AM

 
hi,


    I have tried that but still tree view does not show the new entry it remains as previously Filled data. my mehtod is also public. Is their is any reference problem?

0
hiral
2/6/2009 11:53:01 AM

Hi hiral shah ,

Methods and properties from master page are accessible from child page. I have done this successfully in my machine [populating master page gridview from child page], So I ensure you this works. So please try this [please refer to my previous reply] without using updatepanel in the child page. At this stage, I suspect the use of updatepanel must be the only reason why it is not working. If this still does not work, please post your coding. We could try to see what is actually going.

Hope this helps. Please feel free to ask if any problem persists or if any help is required. Thanks.


Lets always remember to mark the post that helps us as "Mark as Answer".
A .NET Programmer's Experiences
0
sangam100
2/9/2009 8:34:53 AM

hiral shah:

 Hi,

     I have created one Website with master and content page.In Master page i have tree view which fill with the employee name.i want that when i click the save button of content page the new saved entry is display in the tree view along with the previous entry if tree view.

Please Any body help me,

Thanks in advance.


Based on my experience, If you want to update master page when you update the content page, I suggest you add the tree view to the UpdatePanel and set the UpdateModel as 'Always'. Please refer to the following code:

//Master page

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
        <ContentTemplate>
        <%=getText()%>
        </ContentTemplate>
        </asp:UpdatePanel>
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
        
    </div>
    </form>
</body>
</html>

 //Code

    public string getText()
    {
        Random rnd = new Random();
        return "Hello, " + rnd.Next(48).ToString();
    }

 //Default.aspx

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    
    </asp:ScriptManagerProxy>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <%=DateTime.Now.ToString() %>
        <asp:Button ID="Button1" runat="server" Text="Button" />
    </ContentTemplate> 
    </asp:UpdatePanel><%=DateTime.Now.ToString() %>
</asp:Content>
 

Gary yang - MSFT
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Gary
2/10/2009 6:20:29 AM

 hi Gary yang,

        I have tried but it still not working

0
hiral
2/24/2009 10:15:58 AM
Reply:

Similar Artilces:

Refresh a content page without refreshing master page
Hi, I am creating website.In that web site i am using ajax with master page. i have menu button in master page. When i click a menu item ,it will redirect to another page. How can i refresh only content page when i click the menu item( i tried updatepanel placing in master page ,but it is not working). Please ANy body help me, Thanks in advance.Shivakmar Dagam you may get some help at ASP.NET AJAX > The UpdatePanel Control > Using the UpdatePanel Control with Master Pages Thanx, [KaushaL] || BloG || Profile || Microsoft MVP"I would love to change the world, but they won’t give me the source code"Don't forget to click "Mark as Answer" on the post that helped you.This credits that member, earns you a point and mark your thread as Resolved for the sake of Future Readers. Hi, Base on your description, you want to prevent the whole page postback when you click on the menuitem to direct to a new content page? As you said, your menu control is on the master page. In fact, you can not implement the page no-refresh when you re-load the content page. Because the master page class derives from the UserControl class. When the application is executing, the master page just like  another child control. So you can say the master page is not a true page. And, when the page loads, you can notice the navigationURL of the Browser address bar  is the content page's, but not the master page's. So I would suggest you use ...

Refresh a content page without refreshing master page #2
I am developing a website using ajax+Masterpage concept .In my master page ,i have menu controls .The problem is when i click a menu control i want refresh only content page,not total page. So many people said you cant do it.But one day i saw a website  i.e http://www.codegod.de/WebAppCodeGod/Main.aspx How it is possible friends, Please tell me . Thanks in advance.Shivakmar Dagam Putting your content inside an iframe is probably the best way to do that.  Overusing the UpdatePanel for site navigation (as in that example you linked) is generally a mess to work with and ma...

synchronizing content pages to master page when master page is edited
 Hi Guys,I'm new to designing websites so please forgive this basic question.I've updated my master page and the modfications ( adding a couple of extra place holders)  are not reflecting in the content pages.Is there any way we can update the content pages created before the changes to the master page were made.Thanks a lot  :)  abhinaynag: I'm new to designing websites so please forgive this basic question. I've updated my master page and the modfications ( adding a couple of extra place holders)  are not reflecting in the content pages. Is t...

Refresh Master Page from Content page
Folks, I have a Master page with Content page, In the content page,  i have a button, when i clcik on the button the Master page has to referesh. Do you guys have any idea or come across this scenario.Please let me know. IF you need further information i will give example   Thanks kamesh     I don't know the problem exactly ,But you can easily do that by calling Server.Transfer(Request.RawUrl) in the button click event handler.Regards,Anas Ghanem.Note:Please Don't hesitate to click "Report Abuse" link if you noticed something wrong on t...

Content controls have to be top-level controls in a content page or a nested master page that references a master page.
Why in the world am I getting this error? The solutions I have seen either don't apply or don't work.  Here is my master page code:<%@ Master Language="C#" AutoEventWireup="false" CodeFile="TechLMSMasters/MainSide.master.cs" Inherits="MainSide" %> <%@ Register TagPrefix="usercontrol" TagName="Search" Src="~/library/uc/Search.ascx" %> <%@ Register TagPrefix="usercontrol" TagName="UserName" Src="~/library/uc/UserNameDisplay.ascx" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <asp:ContentPlaceHolder id="head" runat="server"></asp:ContentPlaceHolder> </head> <body> <form id="form1" runat="server"> <div> <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"> <DIV class="user" id="userName" runat="server"><usercontrol:username id="userNameDsp" runat="server"></usercontrol:username></DIV> <DIV class="search" id="search" runat="server"><usercontrol:search id="pageSea...

Displaying the content of master page on a web inherited from nested master page
Hello! is it possible to display the content of general master page (common footer) on a web page, inherited from nested master page? Here is my code:Main master: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="1.master.cs" Inherits="_1" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"></head><body> <asp:ContentPlaceHolder ID="generalBody" runat="server"...

How do I put a content home page/form into a master page content placeholder
How do I put the current HTML Home page shown below into the ContentPlaceHolder on the New Content ASP Home page?  Do I put the Current Home Page between the ASP tags on the New Content ASP Home page?  If so, how much of the Current Home Page do I place between the tags?  In addition, how do I put Content ASP Home page into the content placeholder area of a Master page?  I will have multiple pages and want to put them into the content placeholder of the Master page one at a time when I click on the navigation treeview.  I understand how to make a Master page but do n...

ERROR Content controls have to be top-level controls in a content page or a nested master page that references a master page.
This all used to work until about 5 minutes ago. Did I change something? For some reason I am now getting this error: Content controls have to be top-level controls in a content page or a nested master page that references a master page. What I have:  I have a masterpage inside of a directory. That directory is a first level directory with its own web.config file....The whole thing is protected by the web.config file above it (in the main public directory). That main public directory has a masterpage as well. I am not currently linking the two masterpages together becuase...

Error : Content controls have to be top-level controls in a content page or a nested master page that references a master page.
when I make a directory on my root, and in that directory I put a masterpage and a web form ... I get always an error : Content controls have to be top-level controls in a content page or a nested master page that references a master page.   Does somebody know what the problem is ? Is it possible you can't set a masterpage in a directory ... ?Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) i've founded ... I had to nest my masterpage ...Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) Hi Joeri Pansaerts, I am receiving the same error as the one posted her...

how to use form tag in the content page while master page form tag is in use?
Hi there, i have created a bug report form in the content page which uses the master page template. In the master page i am using the menu which should be in the form tag. when i use the form tag in the content it gives me the error as cant use more than one form tag. how can i resolve it. i hav searched in this forum for tht.. i got links which says to disable the content page form tag as form.visible= false. In my situation i cant disable any of the form tag either inthe master page( menu with in the form tag) or content page ( bug report form with server controls with...

refresh only content page, master page remain as it is
in my website ,there is one master page and many links, of other pages, comes in content page.now when user click on any link , i want that  only content page get refresh, not whole page.(master page doesnot get refresh).i am new to ajax, how can i achive this.thank you. VISHAL PAREKH  Master pages aren't like frames because they are basically a template for your pages.  Whenever the content template changes, you are on another page.  The only way around this is using iFrames or making all your content pages into user controls and have one aspx page that change...

Master page should not be refresh while changing content page
Hi I am using asp 2.0 for my application..i used master page..I want something like frame..on left side i have menu link..whenever i click on left menu right side i want page ..but in my case whole master page is refreshing.. I want without refresh whole page ....only content page should be change...When i click on left side panel..right side content should be change..just like frame.... Please help me .. Thanks a lot.....Sejal Patel Hi, you could use an ASP.NET AJAX UpdatePanel control. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark ...

Refreshing the Master page Menu from content page
Hi,       I'm having menu control on the master page, and after button click from the content page I want to refresh the master page control.  after button click the master page menu control is refreshing but, changes not reflected in the menu control.The changes are reflected when user refresh the page.Thanks  As per I can guess, you are performing some operation (may be Menu Item Editing) on button click event. After button click, the page is not being refreshed, it's just the PostBack. So, the masterpage menuitems won't change as the button cli...

Can my web page with a form submit to other web pages forms?
I was wondering if I created an aspx page that had a form on it that I could use the submit button to submit this form's contents to other web pages forms(servers accepting those form's data). I am thinking this would be a great way to update data on particular web pages without having to actually visit those similar web pages. Any ideas, examples would be much appreciated. Thanks in advance.  Yes you can.  It's called Cross Page Posting: http://msdn2.microsoft.com/en-us/library/ms178139.aspxAlso: http://msdn2.microsoft.com/en-us/library/ms178140.aspx might ...

Using an Update Panel in a Content page of Master.page/content.page scenario
When I place an Update Panel inside a content page of a Masterpage I get the following error: Element 'UpdatePanel' is not a known element. This can occur if there is a compilation error in the Web site.  Is the Update Panel suppose to work with a content page, etc.?  Can't seem to find any Docs that talk about where the Update Panel is allowed. Warren     Well, don't you know it.  Right after I put out the original post, I then downloaded the latest release of the ajax extensions and it looks like they have fixed the problem with the update panel not working ...

CSS not accessable from content page when Master Page and Content Pages are in different folder.
I can't seem to find a solution to this problem.  I have a master page and content pages and a CSS file all in the root folder.  I have created a sub folder called News and have added a content page that references the master page in the root directory with the following: MasterPageFile="~/Default.master". The issue is that the page in the News folder is not picking up the CSS styles from the master page.  Has anybody else ran into a problem like this and was able to find a solution? Any help would be greatly appreciated? Thanks, Neeraj    N...

Change content pages of Master Page without Master Page posting back?
so Master + content pages seems like exactly what I want except that they are assembled on postbacks. I am trying to make a site where both Master and Content pages have updatepanels, and the site switches content pages (40+ content pages) without the master page refreshing. Master Pages are assembled on postbacks so I don't think simple master page will work without annoying postbacks. I tried an approach where load content pages inside an Iframe, but the content pages take too long to load becuase each content page loads its own scriptmanager. View/Multiview will probably work but dif...

Programmatically set a content pages Master page to another Master page which is nested in the original
Hello, I have a set up where I have a main masterpage that I use most of the time but occasionally I need to swtch to another masterpage which is actually nested to the main masterpage. The switch needs to happen between postbacks from one content page to another. The problem I'm having, is that it is giving me an exception that it cannot find the content place holders in in the main master page. I have overriden the OnPreInit event of the content page where I check a session variable to see if I need to load the nested page or the main page. When I try to load the page I am presented ...

Having Problem in Posting Value from a Content Page to another Content Page within a Same Master Page
Hello, I have a Master Page which contains two Content pages named: Default.aspx and Default2.aspx. I want to post a TextBox1 value (in Default.aspx) to Default2.aspx in the Master Pages and all my pages are in ContentPlaceHolder, but it is not working.   Is there Any kind of help?  Hi,you can pass value between two web forms by Query string, session  or by using cookieFor query string  refer : http://www.codeproject.com/KB/aspnet/QueryString.aspxSession: save session in default.aspx Session("t1")=text1.text retrieve session astext2.text = session(&quo...

HOW ADD .ASPX PAGE ( as content page) TO MASTER PAGE
hi friends, I have been trying to link  aspx pages to my master page ( which I created afterwards) without any success. I know how to do it when it comes to normal procedure i.e. first create a master page and then content pages. I have a different situation, I already have aspx pages  and now i created a master page but I am unable to link them. I tried  imitating the code from a content page created using normal procedure but thats also not working. Please do help me in this regard, Thank you Prince, Just create a master page and then create a child page. Ch...

master page does not render the page link on content page.
I have a navigation menu in master page as  follows <div class="mainnav-container"> <div class="mainnav-left"> <asp:Menu ID="Menu1" runat="server" DataSourceID=siteMapmain Orientation=Horizontal > </asp:Menu> <ul> <li><a href="Default.aspx" title="GTS Solution Home">Home</a></li> <li><a href="Users/aboutus.aspx" title="About GTS Solution">About Us</a></li> <li><a href="Users/OurServices.aspx" title="Our Services">Our Services</a></li> <li><a href="Users/Profile.a...

Master page with Flash movie cannot refresh web page
in normal website, if u want to go from a.aspx to b.aspx you use Buttons or  hyperlink or hyperlinkbutton. and all these button has callback function that will refresh the page and run the code. But if i use a Flash movie to go from a.aspx to b.aspx, it can redirt to the page but the page doesn't refresh and the back-end code doesn't run  For example, if i have 2 web page and 1 master page, in the master page there is a Flash movie with button and a login/logout function.  when i loged in the website(a.aspx), it will display "lo...

how set length of master page form content page
my master page height is set in 800px, but one of my content pages height  is more then 800px, in this case my when i increase the height of my content page is collapsed of my master page. how can i incrise height of master page from content page. can it is posible. ? Put the code thats forcing the height into an external css file.Make the control that had the height code reference the css class in this new external css file.Add a public property to your master page which lets you access this controls CssClass attribute.When you need a different height access it through the public pro...

Partial page refresh of Content in a master page. Possible?
hi, i think there are a lot of post out there regarding this matter.  Basically I have a master page which contains navigation bar and header.  When user clicks on the navigation, it should load a different page ( content ) with the same master page, but we want only the content to refresh and not refresh the whole master page. can anyone confirm if this is possible in AJAX UpdatePanel? I have read one thread which said its NOT possible, but also some thread which thinks otherwise. Can any MVP confirm this? and if this is not possible what is the best approach to implement such ...

Web resources about - Refresh master page from content page only once - asp.net.web-forms

Refresh rate - Wikipedia, the free encyclopedia
The refresh rate (most commonly the "vertical refresh rate", "vertical scan rate" for CRTs ) is the number of times in a second that a display ...

Facebook Allowing Page Admins To ‘Refresh Share Attachment?’
Facebook appears to have given page administrators the option of refreshing links that they share in posts on their pages . continued... New ...

The article requested cannot be found! Please refresh your browser or go back. (CP,20120705,,-1,AR).
postandcourier.com delivers the latest breaking news and information on the latest top stories, weather, business, entertainment, politics, and ...

Crispin Porter and Refresh Partners Launch Whopper Sacrifice App for Burger King
... has been making the rounds through Facebook’s News Feed today. Why? A new application from Crispin Porter + Bogusky and Toronto-based Refresh ...

Twitter.com gets a refresh
Every month, hundreds of millions of people come to Twitter to see what’s happening in the world. After all, it’s often the best place to turn ...

Refresh - Insight on People You Meet on the App Store on iTunes
Get Refresh - Insight on People You Meet on the App Store. See screenshots and ratings, and read customer reviews.

Maine's First Ship Pepsi Refresh Video.m4v - YouTube
Maine's First Ship Pepsi Refresh Video.

IN PICTURES: Fujitsu's 2012 notebook refresh
New addition consists of a new Ultrabook in the Lifebook U series

Refresh your tiles to refresh your bathroom
Refresh your tiles to refresh your bathroom

Aldi supermarket refresh: Will fancier stores make Aldi more expensive?
ALDI has finally decided to invest a bit of money and refresh its supermarkets. Someone at the famously frugal German retailer has decided looking ...

Resources last updated: 2/19/2016 9:25:59 AM