使用AJAX转到下一页和上一页而无需重新加载页面 [英] Using AJAX Go next page and previous page without reload page

查看:292
本文介绍了使用AJAX转到下一页和上一页而无需重新加载页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我在asp.net中有两页,一页是主页(第1页),其中有一个下一步"按钮.当我单击下一步"按钮时,它将转到下一页(第2页),但我不希望重新加载页面.我尝试使用脚本管理器UpdatePannel,但它仍重新加载页面.您能帮我吗?

Hello everybody!

I have two pages in asp.net and one page is a main page(Page 1) that has a button ''Next''. When I click the ''Next'' button, it will go to the next page(Page 2) but I don''t want the page reload. I tried to use the Script Manager, UpdatePannel but it still reloads the page. Can you help me?

推荐答案

您了解网络的工作原理吗?当您请求页面加载并在浏览器中呈现时,无法停止它.

说明您要完成的工作,也许我们可以提供建议.
Do you understand how the web works? When you make a request for a page it loads and renders in the browser, there is no way to stop it.

Explain what it is you are trying to accomplish and maybe we can offer advice.


UpdatePanel使用部分回发,在这种情况下不会加载整个页面.
另一种方法,您可以使用客户端回调,有关详细信息,请查看链接
另一种方法是,您可以一次性将两个页面的内容加载到一个单独的容器中,例如两个div.首先显示第一个div,然后单击下一步,使用javascript显示另一个div.
UpdatePanel uses Partial Postback, whole page does not get loaded in this case.
Another way, you can use Client Callback, for details have a look to the link
One more way, you can load the content of both page in one go, in a separate container say in two divs. And initially show the first div and on next click show another using javascript.


感谢大家的分享和建议!
thanks all of you for your sharing and advice!


这篇关于使用AJAX转到下一页和上一页而无需重新加载页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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