重定向到另一个页面时传输列表 [英] transfer a list when redirecting to another page

查看:170
本文介绍了重定向到另一个页面时传输列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!我的网页上有一个表单。场景是传输一个列表(字符串)

 List< string> myLIst =  new 列表< string>(); 



当前页面中的另一个页面时表单'单击提交按钮,用户将重定向到该另一页。如何做到这一点?

解决方案

使用会话状态: http://msdn.microsoft.com/en-us/library/ms178581(v = vs.100).aspx [ ^ ]


< blockquote>



你可以通过构造函数将数据发送到其他控件。



  public 列表< string> myStringList; 

// 您的其他页面的构造
< span class =code-keyword> public MyPage(List< string> sendedStringList)
{
myStringList = sendedStringList;
}





祝你好运......


Hi! I have a form in my webpage. The scenario is to transfer a list (of strings)

List<string> myLIst= new List<string>();


in the current page to another page when the form''s submit button is clicked and the user is redirected to that other page. How can this be done?

解决方案

Use Session State: http://msdn.microsoft.com/en-us/library/ms178581(v=vs.100).aspx[^]


Hi,

you can send data to other controls via the constructor.

public List<string> myStringList;

//the construtor of you "otherpage"
public MyPage(List<string> sendedStringList)
{
    myStringList = sendedStringList;
}



Best regards...


这篇关于重定向到另一个页面时传输列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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