GridView中给DropDownList动态绑定数据,及选择列表值后自动更新数据库
protected void sgvFile1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DropDownList ddlAM = ((DropDownList)e.Row.FindControl("ddlAM"));
ddlAM.SelectedIndexChanged += new EventHandler(ddlAM_SelectedIndexChanged);
ddlAM.SelectedIndex = -;
ddlAM.Items.FindByValue(labAM.Text).Selected = true; }
protected void ddlAM_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList ddlAM = (DropDownList)sender;
string i = ddlAM.ID.Substring(ddlAM.ID.LastIndexOf("ddlAM") + , ddlAM.ID.Length - );
bool flage = false;
GridViewRow row = (GridViewRow)ddlAM.NamingContainer;
Label labAMPersonID = (Label)row.FindControl("labAMPersonID" + i); try
{
UpdateKaoQin(labAMPersonID.Text, ddlAM.SelectedValue);
}
catch
{
ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "result", "alert('修改失败!');", true);
}
}
GridView中给DropDownList动态绑定数据,及选择列表值后自动更新数据库的更多相关文章
- (转).net控件dropdownlist动态绑定数据
DropDownList控件的使用(数据绑定)(.net学习笔记二)(2006-10-12 07:28:49) 转载 分类:.net学习笔记 一.在页面初始化时候将集合绑定到DropDownLis ...
- .net控件dropdownlist动态绑定数据 ----转
DropDownList控件的使用(数据绑定)(.net学习笔记二) 一.在页面初始化时候将集合绑定到DropDownListpublic void Page_Load(Object src.Even ...
- GridView 中绑定DropDownList ,下拉框默认选中Label的值
在GridView中,我们 有时候要绑定值. 前台绑定的代码可以这样 <asp:TemplateField HeaderText="当前状态" ItemStyle-Horiz ...
- Gridview中Datakeys 通过主键取得各列的值。
首先在初始化Gridview时候定义主键的数组. GridViewTeacherStudent.DataKeyNames=new string[] {"courseId",&quo ...
- Node.js中的express框架,修改内容后自动更新(免重启),express热更新
个人网站 https://iiter.cn 程序员导航站 开业啦,欢迎各位观众姥爷赏脸参观,如有意见或建议希望能够不吝赐教! 以前node中的express框架,每次修改代码之后,都需要重新npm s ...
- WPF中为ListView动态绑定数据(可参考)
GridView gv = new GridView(); DataTable dt = fieldManageBLL.GetFieldManage(moduleName); for(int i=0; ...
- 为GridView中的DropDownList赋值
<Bda:GridView ID="gvMessage" runat="server" Height="70px" Width=&qu ...
- Gridview中绑定DropDownList
1.页面代码 <asp:TemplateField HeaderText="等级"> ...
- GridView中实现DropDownList联动
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
随机推荐
- Server 非阻塞
import socket import select import Queue port =500 host = "" sock = socket.socket(socket.A ...
- ant-design 实现 搜索功能
1.逻辑代码 list.js /** * 用户列表页 */ import React,{ PureComponent } from 'react' import {connect} from 'rea ...
- Linux下配置两个或多个Tomcat启动
Linux下配置两个或多个Tomcat启动 (2012-08-14 11:59:31) 转载▼ 标签: 杂谈 分类: linux_tomcat 步骤如下: (1)修改/etc/profile文件.添加 ...
- Yii2.0 下的 load() 方法的使用
一 问题 最近在使用 Yii2.0,遇到一个 bug:在 /models/OrderDetail.php add() 方法中调用 load() 方法加载数据,却加载不了. public functio ...
- jumpserver-v0.5.0 应用图解
一. Jumpserver启动 Python: 版本 3.6 1.1 启动Jumpserver 先进入Python虚拟环境 [root@localhost ~]# source /opt/py3/bi ...
- mysql Connector C++ 操作数据库 vs2012
最近想写一个应用程序,要连接和操作mysql数据库,以前只是用c++ builder 操作过mysql数据库,那是用控件操作的,感觉比较弱智,但是c++ builder vcl控件感觉在多线程里比较坑 ...
- java filter、listener、servlet
listener http://www.cnblogs.com/xdp-gacl/p/3969249.html http://blog.csdn.net/java_pengjin/article/de ...
- Coolite简介
Coolite Toolkit 简介 Coolite Toolkit 是一个支持ASP.NET AJAX的Web控件 Coolite Toolkit是基于跨浏览器的ExtJS 库开发而来的,并且简化了 ...
- Matlab The Bisection Method
MATLAB语言 function y=f(x) y=f(x); %函数f(t)的表达式 i=0; %二分次数记数 a=a; %求根区间左端 b=b; %求根区间右端 fa=f(a); %计算f(a) ...
- Blocking & Nonblocking module
/*************************************************** / Blocking and Nonblocking circuit and Simulat ...