.Net 后台获取GridView里<TemplateField>的控件值是否变化
来源:互联网 发布:淘宝apple store优惠券 编辑:程序博客网 时间:2024/05/18 13:27
用遍历的方法即可获得
通过Label标签来监视是否发生变化
List.aspx:(有一个TextBox文本框和Label标签)
<asp:TemplateField HeaderText="优">
<ItemTemplate>
<table>
<tr>
<td width="62px" height="50px" align="center" style="border:solid #333333; border-width:0px 0px 1px 0px">
<%# GetGradeRange1(Container.DataItem) %>
</td>
</tr>
<tr>
<td width="62px" height="57px" align="center" class="grade"> //从这里开始
<asp:Label ID="Lb_1" runat="server" Text='<%# GetGrade1(Container.DataItem) %>' Visible="false"></asp:Label>
<asp:TextBox ID="TxtBox_1" runat="server" Text= '<%# GetGrade1(Container.DataItem) %>' Width="20px" ForeColor="Red" onkeyup="value=value.replace(/[^\d]/g,'')" ></asp:TextBox>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
List.aspx.cs:
foreach (GridViewRow row in GVGuideTecherCheck.Rows) //遍历每一行
{
Lb_flag = row.FindControl("Lb_1") as Label; //每一行的控件
Txt_flag = row.FindControl("TxtBox_1") as TextBox;
if (Lb_flag.Text != Txt_flag.Text && Txt_flag.Text != "") //因为Label不能变 只有TextBox的值变了 所以Label可以监视TextBox
{
//进行你想要的数据库操作
}
}
- .Net 后台获取GridView里<TemplateField>的控件值是否变化
- 获取GRIDVIEW中的TemplateField显示的文本值
- 获取GridView的TemplateField模版中LinkButton列值
- 获取GridView的TemplateField模版中某列值
- Scott Mitchell 的ASP.NET 2.0数据教程之十二:在GridView控件中使用TemplateField
- Scott Mitchell 的ASP.NET 2.0数据教程之十二:在GridView控件中使用TemplateField
- Scott Mitchell 的ASP.NET 2.0数据教程之十二:在GridView控件中使用TemplateField
- asp.net GridView 中TemplateField中的Button或buttonlink控件点击后获得选中的GridView 行号
- [翻译]Scott Mitchell 的ASP.NET 2.0数据教程之十二:在GridView控件中使用TemplateField
- [翻译]Scott Mitchell 的ASP.NET 2.0数据教程之十二:在GridView控件中使用TemplateField
- 用GridView里的服务控件事件,同时获取GridView内的某个字段值
- 获取 asp.net用户控件里的控件值?
- GridView中TemplateField的使用
- 在GridView控件中使用TemplateField
- 在GridView控件中使用TemplateField
- 在GridView控件中使用TemplateField
- 在ASP.NET 2.0中操作数据:在GridView控件中使用TemplateField
- .net后台获取html控件值的2种方法
- C语言基础—流程控制
- 链式队
- OpenCVR wiki
- JDBC_获取数据库连接
- 硬盘安装Win7教程!无光驱无U盘照样装Win7
- .Net 后台获取GridView里<TemplateField>的控件值是否变化
- lr11破解
- 华为2014机试字符串压缩
- android webview js交互 第一节 (java和js交互)
- Reverse Linked List 解法与测试
- 在使用requests模块时报错:InsecurePlatformWarning:
- 弹幕效果
- leetcode 155 Min Stack
- acdream 1726 A Math game (部分和问题 DFS剪枝)