asp.net获取行索引
来源:互联网 发布:淘宝天猫不能改价格吗 编辑:程序博客网 时间:2024/05/23 02:00
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int index = 0;
if (e.CommandName == "EditCOQTY" || e.CommandName == "EditPO" || e.CommandName == "EditHKIn" || e.CommandName == "EditHKOut")
{
GridViewRow gvrow = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); //获取被点击的linkButton所在的GridViewRow
index = gvrow.RowIndex; //获取到行索引 RowIndex
}
string ftyno = GridView1.Rows[index].Cells[0].Text;//厂号
if (e.CommandName == "EditCOQTY")
{
Response.Redirect("HK8008COQty.aspx?ftyno=" + ftyno);
}
else if (e.CommandName == "EditPO")
{
Response.Redirect("HK8008COQty.aspx?ftyno=" + ftyno);
}
else if (e.CommandName == "EditHKIn")
{
Response.Redirect("HK8008COQty.aspx?ftyno=" + ftyno);
}
else if (e.CommandName == "EditHKOut")
{
Response.Redirect("HK8008COQty.aspx?ftyno=" + ftyno);
}
}
{
int index = 0;
if (e.CommandName == "EditCOQTY" || e.CommandName == "EditPO" || e.CommandName == "EditHKIn" || e.CommandName == "EditHKOut")
{
GridViewRow gvrow = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer); //获取被点击的linkButton所在的GridViewRow
index = gvrow.RowIndex; //获取到行索引 RowIndex
}
string ftyno = GridView1.Rows[index].Cells[0].Text;//厂号
if (e.CommandName == "EditCOQTY")
{
Response.Redirect("HK8008COQty.aspx?ftyno=" + ftyno);
}
else if (e.CommandName == "EditPO")
{
Response.Redirect("HK8008COQty.aspx?ftyno=" + ftyno);
}
else if (e.CommandName == "EditHKIn")
{
Response.Redirect("HK8008COQty.aspx?ftyno=" + ftyno);
}
else if (e.CommandName == "EditHKOut")
{
Response.Redirect("HK8008COQty.aspx?ftyno=" + ftyno);
}
}
0 0
- asp.net获取行索引
- Asp.net技巧:gridview获取当前行索引的方法
- ASP.NET中gridview获取当前行的索引值
- Asp.net技巧:gridview获取当前行索引的方法
- asp.net中获取GridView当前行的索引
- Asp.net Mvc问题索引
- ASP.NET中获取DridView点击的按钮后的索引
- asp.net 获取 URL
- ASP.NET获取基本信息
- asp.net 获取手机号码
- ASP.Net获取错误信息
- 新瓶旧酒ASP.NET AJAX系列文章索引
- 新瓶旧酒ASP.NET AJAX系列文章索引
- 新瓶旧酒ASP.NET AJAX系列文章索引
- 新瓶旧酒ASP.NET AJAX系列文章索引
- 新瓶旧酒ASP.NET AJAX系列文章索引
- 《ASP.NET MVC案例教程》索引贴
- 新瓶旧酒ASP.NET AJAX系列文章索引
- S3C2416裸机开发系列十九_Fatfs下播放录音wav音频文件
- jquery ajax传递数组参数问题
- Sublime Text 3 快捷键汇总
- JS获取服务器时间
- adb命令恢复出厂设置
- asp.net获取行索引
- 在Servlet中调用spring中定义的Bean
- Linux内核汉字显示技术
- 实验1——N皇后问题的求可行解个数(回溯法)
- 使用迭代法对二叉树进行前序遍历——Leetcode系列(七)
- 线程pthread_self与gettid 的区别
- extjs3.2+struts2实现多文件上传excel并插入到数据库
- 怎么才能赚积分呢?
- Lumberjack库在GCDAsyncSocket上的打印输出