string[] abc = e.CommandArgument.ToString().Split(',');
string officeId = null;// abc[0];
string TypeId = null;// abc[1];
string ManuName = null;// abc[2]
if (abc.Length == 4)
{
officeId = abc[0];
}
else
{
officeId = abc[0];
TypeId = abc[1];
ManuName = abc[2];
}
提示: TypeId = abc[1];索引超出了数组界限
怎么修改呢
string officeId = null;// abc[0];
string TypeId = null;// abc[1];
string ManuName = null;// abc[2]
if (abc.Length == 4)
{
officeId = abc[0];
}
else
{
officeId = abc[0];
TypeId = abc[1];
ManuName = abc[2];
}
提示: TypeId = abc[1];索引超出了数组界限
怎么修改呢
解决方案 »
- 委托怎么在传递参数的时候加out呢?
- 急需分页:已知DataSet、当前第几页、每页条数,如何操作
- 求救,ASP.NET的Session与Cookie的问题!
- Compiler Error Message: BC30456: 'Culture' is not a member of 'ASP.personalattendanceview_aspx'.
- 谁能提供这样一个简单的实例源码
- 怎么获取一个checkboxlist 有多少个被选中了,要那个数量
- 请教一个简单的问题,是textbox的问题。
- DataGrid的HyperLinkColumn怎么同时传多个字段给下一个页面
- 在线给分,简单问题..
- mvc中url的解码!?
- 关于一个数组的问题..
- 问下使用VS进行Web开发使用什么布局?
string[] abc = e.CommandArgument.ToString().Split(',');
string officeId = null;// abc[0];
string TypeId = null;// abc[1];
string ManuName = null;// abc[2]
if (abc.Length == 4)
{
officeId = abc[0];
}
else
{
if(abc.Length>=1)
officeId = abc[0];
if(abc.Length>=2)
TypeId = abc[1];
if(abc.Length>=3)
ManuName = abc[2];
}