如何从隐藏字段向数组列表中插入多个值 [英] How to insert multiple values from hidden field to array list
本文介绍了如何从隐藏字段向数组列表中插入多个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
删除了dupelicate
i hava此字段中的多个值
i需要插入值列表
我尝试过的事情:
removed dupelicate
i hava multiple value in this field
i need to inset the values to list
What I have tried:
foreach (TreeNode node in TRVPersonnel.CheckedNodes)
{
hftreenodevalue.Value += node.Value + ",";
Session["idRole"] = hftreenodevalue.Value;
list = Session["idRole"] as List<string>;
foreach (var L in list)
{
}
}
推荐答案
因为你要存储以逗号分隔格式的数据,你应该用逗号分割得到字符串数组/列表
Since you are storing the data in comma separated format, you should split by comma to get the string array/list
string csv = Convert.ToString(Session["idRole"]);
List<string> list = csv.Split(',').ToList();
这篇关于如何从隐藏字段向数组列表中插入多个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文