Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 29th, 2007, 12:53 AM
Registered User
 
Join Date: Jun 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to skyler
Default Master Page refresh only the content

Hi. Does someone know how to implement a Master Page that refresh only the content.

Thank you very much.


 
Old April 30th, 2007, 08:00 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

yep you need to use ajax to do that...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
 
Old May 1st, 2007, 06:54 PM
Registered User
 
Join Date: Jun 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to skyler
Default

Thank you very much gbianchi for the quick reply. I tried that already but didn't work. Take a look in the master Page code. And tell me what I should do.

    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:HyperLink ID="HyperLink1" NavigateUrl="~/Default.aspx" runat="server">
                        Page1
                </asp:HyperLink>&nbsp; | &nbsp;
                <asp:HyperLink ID="HyperLink2" NavigateUrl="~/Default2.aspx" runat="server">
                        Page2
                </asp:HyperLink><br />
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                </asp:ContentPlaceHolder>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
 
Old May 1st, 2007, 10:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there...

the update panel should be inside the child page, not the master page, that way you only refresh the child..

but left the script manager in the master page...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
 
Old May 2nd, 2007, 01:20 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

But still, even with the AJax panel in a child page, you still get page refreshes.

Since child pages are all separate pages, your browser requests a full new page whenever you browse from page to page.

If you want to minimize that, you can use the AJAX panel to refresh only parts of the page; however, it won't work for completely new page requests.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old May 2nd, 2007, 06:52 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

In order to have a "content only" update using AJAX you need to implement your "pages" as user controls. You then have a single page (in this case you don't even need to use master pages). Your navigation links then cause the user control loaded in the page content area to change. This can get tricky though. Honestly, for this type of behavior, you might be better off to use an iFrame. (That is actually how a lot of google's "ajax" powered applications work.)

Using the ajax/user control method, you can not use regular hyperlinks as they get handled as a new full page request instead of a postback.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Master Page Method: Code-Behind for Content Page kwilliams ASP.NET 2.0 Professional 3 June 2nd, 2008 12:57 PM
Master Page and Content Page with Java script Harjinder ASP.NET 2.0 Professional 1 February 1st, 2008 10:31 AM
master page and content page interaction mrjoka ASP.NET 2.0 Basics 0 March 15th, 2007 10:45 AM
Access Master page control from Content page. angshujit ASP.NET 2.0 Basics 3 January 11th, 2007 06:20 AM
Master Page/Content Pages coleenh ASP.NET 2.0 Basics 1 September 26th, 2006 02:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.