什么是刷新内容,而无需ASP.NET网页上刷新整个页面的最佳布局? [英] What's the best layout to refresh content without refreshing the whole page on ASP.NET web page?

查看:111
本文介绍了什么是刷新内容,而无需ASP.NET网页上刷新整个页面的最佳布局?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个初学者,网站开发和ASP.NET。我创建一个Web应用程序(不公开,所以搜索引擎优化,书签等不关心)与头部的顶部典型布局,导航左侧,内容上的权利。我想要的内容,而不在整个页面中选择导航栏上的东西时,重装升级。什么是实现这个典型的方法是什么?与母版内容网页,并使用一个UpdatePanel(试过,但似乎并没有工作,我猜是因为URL每个内容页是不同的)?使用框架?使用内容部分的iframe?在内容部分用户控件?

I am a beginner to web development and ASP.NET. I am creating a web application (not public, so SEO, bookmarking etc. is of no concern) with the typical layout of header on top, Navigation on the left, content on the right. I want the content to update without the whole page reloading when selecting something on the navigation bar. What is the typical way to implement this? MasterPage with ContentPages and using an UpdatePanel (tried this, but does not seem to work, I guess because the URL is different for each content page)? Using Frames? Using an iFrame for the content part? UserControls for the content part?

谢谢,
蒂莫

推荐答案

jQuery是好东西,但是我认为有在某些情况下的UpdatePanel来进行的情况。如果你正在构建你不要指望有成长支持的用户数量疯狂的私人网站,你可能有一个更容易的使用UpdatePanel的开始。的UpdatePanel都提出了更快速开发和原型设计,并可以带你很长的路要走。您可以随时换出来一个接一个在未来,如果你发现需要。

JQuery is good stuff, however I think there's a case to be made for UpdatePanels in some situations. If you're building a private site that you don't expect to have to grow to support a crazy amount of users, you'll probably have a easier time getting started using UpdatePanels. UpdatePanels are made more for rapid development and prototyping and can take you a long way. You can always swap them out one-by-one in the future if you find the need to.

如果你决定走这条路,用一个母版的基本布局,然后创建一个Web窗体(使用母版ASPX)为你想保持彼此分开各主页。从那里,每一页的内容可以包括要与AJAX更新部分中的UpdatePanel。通常情况下,我使用用户控件封装特定部分分手的幕后页。

If you decide to go this route, use a MasterPage for the basic Layouts and then create a Web Form (aspx using MasterPage) for each main page that you want to keep separate from one another. From there, the content of each page can include UpdatePanels within the sections that you want to update with AJAX. Generally, I break up the page behind the scenes using User Controls to encapsulate specific sections.

这篇关于什么是刷新内容,而无需ASP.NET网页上刷新整个页面的最佳布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆