如何通过列表中的Response.Redirect参数 [英] How to pass list as a parameter in response.redirect

查看:149
本文介绍了如何通过列表中的Response.Redirect参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Prob1:我有2列出了我想我会被重定向下一个页面来访问。
当前的结果,
 当我通过我的结果,在url它显示的列表数据类型。

Prob1:I have 2 lists which i want to access in the next page which i will be redirecting. Current result, When i pass my result, in the url it shows the List data type.

例如:System.Collections.Generic.List1 [IDataEntities.ISearchResultsEntity]

Prob2:我在阿贾克斯后一个方法调用,我可以导航到该方法,但里面我做的Response.Redirect其失败说Threadabort异常

Prob2:I have a method call in ajax post,I am able to navigate to the method but inside i have done response.redirect which fails saying "Threadabort exception"

推荐答案

使用会话来保存您的列表如下

use Session to hold your list as below

Session["mylist"] = list;

您可以从下一个页面访问它,还有很多其他的方法。请查看此链接

you can access it from next page, there are many other ways. please check this link.

当你调用的Response.Redirect 叫它如下

Response.Redirect(url, false);
Context.ApplicationInstance.CompleteRequest();

但是不要从服务器端Ajax调用重定向,那些Ajax调用完成后,您可以从客户端的呼叫重定向。

but don't do Redirect on ajax call from server side, ones ajax call completed you can redirect from client side call.

这是成功的AJAX回调方法

on success ajax call back method

window.location = '[url to redirect]';

这篇关于如何通过列表中的Response.Redirect参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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