Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 29th, 2007, 12:53 AM
Registered User
 
Join Date: Jun 2005
Location: , , .
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.


  #2 (permalink)  
Old April 30th, 2007, 08:00 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
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
================================================== =========
  #3 (permalink)  
Old May 1st, 2007, 06:54 PM
Registered User
 
Join Date: Jun 2005
Location: , , .
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>
  #4 (permalink)  
Old May 1st, 2007, 10:47 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
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
================================================== =========
  #5 (permalink)  
Old May 2nd, 2007, 01:20 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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.
  #6 (permalink)  
Old May 2nd, 2007, 06:52 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.