ASP.NET的GridView里编辑模板弹窗怎么把值传过去 GridView修改传值弹窗 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ASP.NET数据控件GridView编辑模板传值设置问题//GridView设置 <asp:GridView ID="ClassList" runat="server" AutoGenerateColumns="False" CellPadding="4" Font-Size="11pt" GridLines="None" Width="468px" OnRowCancelingEdit="ClassList_RowCancetingEdit" OnRowDeleting="ClassList_RowDeleting" OnRowEditing="ClassList_RowEditing" OnRowUpdating="ClassList_RowUpdating" ForeColor="#333333" AllowPaging="True" AllowSorting="True" OnPageIndexChanging="ClassList_PageIndexChangging" PageSize="6" OnRowDataBound="ClassList_RowDataBound"> <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> <Columns> <asp:TemplateField HeaderText="选项"> <ItemTemplate> <asp:CheckBox ID="CheckBox1" runat="server" Font-Size="9pt" Height="1px" Width="1px" /> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="ST_c_id" HeaderText="类型编号" ReadOnly="True" /> <asp:BoundField DataField="ST_c_name" HeaderText="文章类别" /> <asp:CommandField HeaderText="编辑" ShowEditButton="True" /> <asp:CommandField HeaderText="删除" ShowDeleteButton="True" /> </Columns> <SelectedRowStyle BackColor="#C5BBAF" ForeColor="#333333" Font-Bold="True" /> <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /> <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="White" /> <RowStyle BackColor="#E3EAEB" /> <EditRowStyle BackColor="#7C6F57" /> </asp:GridView>//codego.net/tags/11/1///编辑设置传值修改数据行绑定信息显示protected void ClassList_RowEditing(object sender, GridViewEditEventArgs e) { ClassList.EditIndex = e.NewEditIndex; ST_Type_List_Bind(); } protected void ClassList_RowUpdating(object sender, GridViewUpdateEventArgs e) { string sqlstr0 = "update ST_class set ST_c_name='" + ((TextBox)(ClassList.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim() + "'where ST_c_id='" + ClassList.DataKeys[e.RowIndex].Value.ToString() + "'"; //调用公共类中的ExceSQL方法执行SQL语句 My_sqldata.ExceSQL(sqlstr0); ClassList.EditIndex = -1; ST_Type_List_Bind(); } 在RowDataBound时,给每行添一个删除按钮用<a href="void(0)" onclick="JS事件">删除</a>这个Js事件就是用来传值和弹出窗口的 C# winform 中英双语版本切换 那位大牛写过模拟登陆live.com 不知道可以发一下源码不? 控件代码没有错误,为什么单击button控件后没有反应 谢谢各位 c# 获取硬盘序列号的方法,最好不用系统api 各位大大,急切求助:help 文字作成xml档.... 请教:在web上连ORACLE 最近想做一个bug管理系统,请大家多提点建议,谢谢! 求string中查询 在配置Remoting的服务器时,为什么 system.runtime.remoting 说找不到,必须将其复制到当前目录时才好使 数值的保留百分号和小数点后两位。 关于往tabcontrol中动态添加form的实现
//GridView设置
<asp:GridView ID="ClassList" runat="server" AutoGenerateColumns="False"
CellPadding="4" Font-Size="11pt" GridLines="None" Width="468px" OnRowCancelingEdit="ClassList_RowCancetingEdit" OnRowDeleting="ClassList_RowDeleting" OnRowEditing="ClassList_RowEditing" OnRowUpdating="ClassList_RowUpdating" ForeColor="#333333" AllowPaging="True" AllowSorting="True" OnPageIndexChanging="ClassList_PageIndexChangging" PageSize="6" OnRowDataBound="ClassList_RowDataBound">
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:TemplateField HeaderText="选项">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Font-Size="9pt" Height="1px" Width="1px" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ST_c_id" HeaderText="类型编号" ReadOnly="True" />
<asp:BoundField DataField="ST_c_name" HeaderText="文章类别" />
<asp:CommandField HeaderText="编辑" ShowEditButton="True" />
<asp:CommandField HeaderText="删除" ShowDeleteButton="True" />
</Columns>
<SelectedRowStyle BackColor="#C5BBAF" ForeColor="#333333" Font-Bold="True" />
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
<RowStyle BackColor="#E3EAEB" />
<EditRowStyle BackColor="#7C6F57" />
</asp:GridView>//codego.net/tags/11/1/
//编辑设置传值修改数据行绑定信息显示
protected void ClassList_RowEditing(object sender, GridViewEditEventArgs e)
{
ClassList.EditIndex = e.NewEditIndex;
ST_Type_List_Bind();
}
protected void ClassList_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
string sqlstr0 = "update ST_class set ST_c_name='" + ((TextBox)(ClassList.Rows[e.RowIndex].Cells[2].Controls[0])).Text.ToString().Trim() + "'where ST_c_id='" + ClassList.DataKeys[e.RowIndex].Value.ToString() + "'";
//调用公共类中的ExceSQL方法执行SQL语句
My_sqldata.ExceSQL(sqlstr0);
ClassList.EditIndex = -1;
ST_Type_List_Bind();
}
这个Js事件就是用来传值和弹出窗口的