从viewstate获取id [英] Get id from viewstate
本文介绍了从viewstate获取id的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友们,
我有数据处于查看状态(查看状态名称为Sample)
视图状态包含列ID,名称
DataTable _Sample = new DataTable();
_Sample = MagazinesDataSource.Load(_magazinesEntity) ;
ViewState [Sample] = _Sample;
此视图状态包含100条记录
当我通过名称查看状态时我需要从视图状态Id
如何获取数据
谢谢
hi friends ,
I have data in view state (view state name is "Sample")
view state contains columns Id,Name
DataTable _Sample= new DataTable();
_Sample= MagazinesDataSource.Load(_magazinesEntity);
ViewState["Sample"] = _Sample;
this viewstate consists of 100 records
I need "Id" from view state when i pass the "Name" to view state
how can i get the data
thank you
推荐答案
无法理解你的要求是什么..但仍然可以尝试这个代码。它可以帮助你。
Not able to understand what exactly your requirement .. but still try this code.it may help you.
ViewState["data"] = "12,Rajesh";
string name = ViewState["data"].ToString();
string[] id = name.Split(',');
Response.Write("Id is : " + id[0].ToString());
Response.Write("<br>Name is : " + id[1].ToString());
这篇关于从viewstate获取id的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文