如何在ajax服务中重定向 [英] How to Redirect with in the ajax service

查看:366
本文介绍了如何在ajax服务中重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在ajax服务中重定向

i我使用此代码无法正常工作



HttpContext.Current.Response.Redirect (Acces.aspx);

How to Redirect with in the ajax service
i am using this code did not working properly

HttpContext.Current.Response.Redirect("Acces.aspx");

推荐答案

您不应该从服务重定向。



相反,从Service返回一些值,告诉您是否重定向。如果是,则通过设置 window.location 属性重定向,如果您想从客户端进行。否则从服务器端使用 Response.Redirect
You should not redirect from the Service.

Instead, return some value from Service, which tells you whether to redirect or not. If yes, then redirect by setting the window.location property if you want to do from client side. Else use Response.Redirect from Server side.


这篇关于如何在ajax服务中重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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