Response.Redirect()不适用于更新面板 [英] Response.Redirect() Not working with update panel

查看:103
本文介绍了Response.Redirect()不适用于更新面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要你的大脑.

我需要在使用response.Redirect时避免回发,因为我的所有表单都在更新面板中.

当我使用Response.Redirect()从一页导航到另一页时,整个页面都会刷新.

我要避免它.
请给一个解决方案

问候,
sajith

Hi,

I need your brains.

I need to avoid Postback while using response.Redirect since all my form are in an update panel.

When I navigate from one page to another using Response.Redirect() the whole page will get refreshed.

I need to avoid it.
Kindly give a solution

Regrds,
sajith

推荐答案

尝试将以下块放入web.config

try to put following block in web.config

<system.web>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule,System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
</System.web>




据我所知.

response.redirect()表示您要在这里显示另一页吗?

即使您使用updatepanel,整个页面也会刷新,因为response.redirect只需将另一个页面的url放入地址栏中,这不过是往返.

第一个响应来自浏览器,然后第二个请求发送到服务器以重定向页面.第二个响应与您的下一页一起进入浏览器.



通过使用Jquery,可以避免从一页到另一页的整个页面刷新.

如果使用
Hi,

Upto my knowledge.

response.redirect() means here you are going to display another page right?

even though you are using updatepanel the whole page will refresh because response.redirect just place your another page url into address bar this is nothing but round trip.

first response comes to browser.then second request send to server for redirected page.then second response comes to browser with your nextpage .



Two avoid whole page refreshing while moving from one page to another is achieved by using Jquery.

If you use


("#Divid").load("yournextpage.aspx");
("#Divid").load("yournextpage.aspx");



您可以达到您的要求.

您只能将updatepanel用于部分页面刷新,而不能避免在显示另一页面时刷新.

希望你能理解我说的话

这是我的示例代码



you can reach your requirement.

you can use updatepanel for partial page refreshing only.not to avoid refreshing while showing another page.

I hope you''ll understood what I said

Here my sample code is

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Testing Jquery methos</title>
    <script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script language ="javascript" >
      
        function openpage(pagename) {


这篇关于Response.Redirect()不适用于更新面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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