返回首页

如何通过一个查询字符串数组?

回答

评论会员:游客 时间:2012/02/07
KARTHIKHarve:我觉得你不能传递数组或任何其他对象,通过查询字符串字符串值除外。相反,你可以使用会话变量。试试这个..在第一页。codeprelang="c#"spanclass="code-comment"///spanspanclass="code-comment"Set/spanSession[spanclass="code-string""/spanspanclass="code-string"Variable"/span]=ArrayObj;/pre/code在两页。{C}希望它可以帮助..:89|邮编
尝试
1.aspx

 

ArrayList arr = new ArrayList();

arr.Add(file1?;

arr.Add(file2?;

arr.Add(file3?;

string arry = String.Join(?? ((string[])arr.ToArray(typeof(String))));

Response.Redirect(?.aspx?file=?+ arry);

 

2.aspx

 

string[] files = Request["file"].ToString().Split(??;

ArrayList arry = new ArrayList();

foreach (string file in files)

{

arry.Add(file);

}

另一种方式

{体C3}
评论会员:koolprasad2003 时间:2012/02/07
你不能
查询刺痛只支持纯文本转换。查询字符串允许数量有限的数据,也并不安全,在接收页的第二件事,你会得到一个字符串,它是不是你的对象的实际数据类型的数据。

使用会话,cookie,而不是



在任何分隔符分隔的singlr字符串,你需要把你的数组。然后通过查询字符串