0

I want to use a different model for site.master. Instead of of the old "<"asp :Content PlaceHolder ID="SideContent" runat="server" "/ >" tags I want to use ajax to dynamically display my aspx pages(within Site.master). so no complete reload unless explicitly asked for.

I also want to do this with very little change to the way my project is organized.

4
  • And what is the specific question you want help with? How to dynamically load .aspx pages within Site.Master? Aug 5, 2010 at 13:37
  • Can you explain in more detail the reloading issue you are trying to work around? Aug 5, 2010 at 13:41
  • joe - are you refering to adding jquery type functionality to named/id divs in the contentplaceholders?? if so, then you may want to look at nested masterpages
    – jim tollan
    Aug 5, 2010 at 13:47
  • Yes Tobias -completely replacing the way it is done now only redoing the page if wanted. teknohippy no issue to work around per se just have a site.master that has "heavy" resources to reload on each request. in fact I think the standard should be all content pages be ajax unless specifically request a complete reload
    – Joe
    Aug 5, 2010 at 14:21

1 Answer 1

1

Joe,

if you're using mvc, it'll be no problem (jQuery partialview updates etc, etc). however, as you haven't tagged as such i'm presuming webforms (oh, i see the asp.net mvc tag is there now - however, i'll leave the reply as i wrote it at the time as it may be of interest). the good news is, all is not lost and there are in fact page methods that can be used in webforms to stunning effect. i did a quick google and this article seems to nail what i was thinking about:

http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/

i can't comment on the technique too much as i'm definately more in the mvc camp these days, but this is how i'd have done it had i been still heavily using webforms.

jim

[edit] - as the mvc tag is now present, that changes my answer above (or at least means that i should add a little re mvc). what you could do on the masterpage is to ensure that your content pages were ALL partialviews and that your menus invoked a partial refresh. the masterpage would have a 'content' div that you'd update via each jquery menu request. in effect only the inner section of the page would ever change. i know you'd said 'little' change, but depending on the width of your pages, this suggestion could be fairly simple or complex depending on your viewmodels etc. i'll be interested to see further comments.

also, take a look at this (oldish) jeff palermo article re partials and different masterpages: http://jeffreypalermo.com/blog/asp-net-mvc-and-the-templated-partial-view-death-to-ascx/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.