比如在前台aspx页面的<asp:gridview>中 有个<asp:textbox id="box" runat="server"/>
但在后台程序程序中无法识别id为box,因此也不能取到box的值,
怎样才能解决。
但在后台程序程序中无法识别id为box,因此也不能取到box的值,
怎样才能解决。
解决方案 »
- 怎样转换成 DateTime类型的? 求解。。
- 请教:multipage toolbar在vs2005 developerment server下不好用
- 两个DATAGRID导出EXCEL的问题,希望大家帮帮忙!!!
- 请教:下载文件出现乱码
- MVC 2 ViewModel绑定dropdownlist 和LIST 取值问题。
- 怎样一次性获取URL传过来的值?
- 请教@Html.ActionLink的使用问题
- 我在css里面为按钮设置了背景图片,在windowsxp中浏览为什么图片显示不出来?急
- 如何实现多文件选择一起上传?
- 怎样从数据库中读出数据,然后赋值给文本框啊?就像以前做信息修改那样~
- vbscript如何调用公共函数
- 关于跨域的问题!!!!!!!!!!
GridView就意味着有很多行。你想要哪个行的?还是一个一个取?GridView_RowDataBound事件里可以取到值。
<ItemTemplate>
<asp:LinkButton ID="LinkButton4" runat="server" CommandName="update" >编辑</asp:LinkButton>
<asp:LinkButton ID="LinkButton5" runat="server" CommandName="delete" OnClientClick="return confirm('确认删除该合同吗?');" CommandArgument="<%#GridView1.Rows.Count%>">删除</asp:LinkButton>
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Check" OnClientClick="return confirm('确认启用该合同吗?');" CommandArgument="<%#GridView1.Rows.Count%>">审核</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" CommandName="unCheck" OnClientClick="return confirm('确认作废该合同吗?');" CommandArgument="<%#GridView1.Rows.Count%>">作废</asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CommandName="Note" CommandArgument="<%#GridView1.Rows.Count%>" >消费明细</asp:LinkButton>
</ItemTemplate>后台取得当前行的某个按钮(相当于checkbox) if (e.CommandName == "Check")//审核
{
int i = Convert.ToInt32(e.CommandArgument);//当前行索引
TbcontractInfo model_Contract = TbcontractBLL.GetModel(GridView1.Rows[i].Cells[0].Text.ToString());
}
string str = "";
foreach (GridViewRow row in this.GridView1.Rows)
{
TextBox tb = (TextBox)row.FindControl("tb_Name");
str += tb.Text;
}
this.test.Text = str;