惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
Engineering at Meta
Engineering at Meta
有赞技术团队
有赞技术团队
月光博客
月光博客
M
MIT News - Artificial intelligence
V
Visual Studio Blog
Stack Overflow Blog
Stack Overflow Blog
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
I
InfoQ
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
雷峰网
雷峰网

博客园 - 御不凡

中国国内ip大全 win10找回自带的windows照片查看器——打开jpg、png、gif、psd其他格式的图片 ping 命令回显带时间 DellR410配置Raid1并安装Esxi6.5 WinServer2016破解密码后,服务中ASP.net State service没了 excel批量去单引号,批量改文本格式,批量加坐上角标 win10共享打印机服务机以及客户机设置方法 sqlserver不同服务器数据库联合查询 word设置标题多级编号 VS2019,无法启动程序xxx.exe,系统找不到指定的文件,重新生成解决方案报错 .net Core Web API VS2017从安装到部署,用c#开发的webservice在Linux里使用 windows任务计划不执行的解决方法 ASP.NET点击按钮回车提交web页面回车提交点击回车按钮提交 mySQL将表结构转化成表格格式并插入到word文档中,表结构转化为数据库设计说明书 解决页面favicon.ico文件不存在提示404问题 禁止button响应回车(.net页面) SQLserver导入csv文件 VS2010 c#创建及调用Webservice SQL Server Always on 日志收缩
GridView中DropDownList传参
御不凡 · 2023-03-14 · via 博客园 - 御不凡

<asp:TemplateField HeaderText="是否空闲">
<ItemTemplate>
&nbsp;
<asp:HiddenField ID="hidKongXian" Value='<%#Eval("是否空闲")%>' runat="server" />
<asp:DropDownList ID="ddlKongXian" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlKongXian_SelectedIndexChanged">
<asp:ListItem Text="--选择--" Value="-1"></asp:ListItem>
<asp:ListItem Text="在用" Value="在用"></asp:ListItem>
<asp:ListItem Text="空闲" Value="空闲"></asp:ListItem>
<asp:ListItem Text="不确定" Value="不确定"></asp:ListItem>
</asp:DropDownList>
&nbsp;
</ItemTemplate>
<ItemStyle Width="300px" />
</asp:TemplateField>

//是否空闲
protected void ddlKongXian_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList ddlKongXian = sender as DropDownList;
TableCell cell = (TableCell)ddlKongXian.Parent;
GridViewRow item = (GridViewRow)cell.Parent;
string id = item.Cells[1].Text;
string kongXian = ddlKongXian.SelectedValue;
string sqlStr = "update myTable set 是否空闲='" + kongXian + "' where id=" + id;
sqlHelp.inUpDelInfo(sqlStr);
this.BindData();
}