weixin_33695082 2010-08-05 13:32 采纳率: 0%
浏览 19

ASP.NET MVC Ajax site.master

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.

  • 写回答

1条回答 默认 最新

  • weixin_33716557 2010-08-05 13:53
    关注

    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/

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog