如何在另一个ASPX的DIV在运行时动态显示一个ASPX? [英] How to display an ASPX in another ASPX's DIV dynamically at runtime?

查看:655
本文介绍了如何在另一个ASPX的DIV在运行时动态显示一个ASPX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我想在ASP.NET做:

Here is what I am trying to do in ASP.NET:

创建一个网页叫做Main.aspx。这个页面有一个DIV和一个按钮。

Create one page called Main.aspx. This page has a DIV and a buttons.

浏览器加载Main.aspx。然后,当我按一下按钮,我想页面Page99.aspx加载到DIV在Main.aspx动态,但没有Main.aspx需要回发。

The browser loads Main.aspx. Then when I click the button, I want to load page Page99.aspx into the DIV in Main.aspx dynamically, but without Main.aspx requiring a postback.

所以,Main.aspx负载过一次,此后所有Main.aspx显示的内容将来自不同的.aspx页面。

So, Main.aspx loads once, and thereafter all the content displayed in Main.aspx will come from different .aspx pages.

诗。我在寻找一个解决方案如上,但不使用框架。

Ps. I'm looking for a solution as above, but not using frames.

更新1
我应该指出,Page99不是一个简单的HTML页面。它将包含Web控件。

UPDATE 1 I should mention that Page99 is not a simple HTML page. It will contain Web controls.

推荐答案

据我所知,除非在使用iframe,有没有办法放入一个aspx页面到另一个。

As far as I know, barring the use of iframes, there is no way to load one aspx page into another.

使用回发或AJAX,可以使用用户控件(ASCX)代替。它们可以包含pretty大致相同内容的页面就可以,无论如何,或使用母版。

With postbacks or ajax, you can use UserControls (ascx) instead. They can contain pretty much the same content a page can anyway, or use a MasterPage.

如果你想有没有回传,阿贾克斯可能是去了,但再次,它不会让你一个aspx页面加载到其他,只有改变你的页面的内容(除其他的方式事情)。

If you wish to have no postbacks, ajax is probably the way to go, though again, it does not allow you to load an aspx page into another, only to change the content of the page you're on (amongst other things).

我不知道其他平台的Web开发虽然,他们可能有一个解决方案,更接近你想要做什么,所以如果asp.net是不是必须,你应该考虑检查出其他平台。

I'm not sure about other platforms for web development though, they may have a solution closer to what you want to do, so if asp.net is not a "must", you should consider checking out other platforms.

这篇关于如何在另一个ASPX的DIV在运行时动态显示一个ASPX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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