网站后台管理之数据列表绑定、删除和修改(16)
发布时间:2021-06-07
发布时间:2021-06-07
前台代码:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" onrowdatabound="GridView1_RowDataBound"
onrowcommand="GridView1_RowCommand" onrowediting="GridView1_RowEditing" onrowcancelingedit="GridView1_RowCancelingEdit" onrowupdating="GridView1_RowUpdating"> <Columns>
<asp:TemplateField HeaderText="选择"> <EditItemTemplate>
<asp:HiddenField ID="HiddenFieldId" Value='<%# Eval("articleId") %>' runat="server" />
<asp:CheckBox ID="CheckBox1" runat="server" /> </EditItemTemplate> <ItemTemplate>
<asp:HiddenField ID="HiddenFieldId" Value='<%# Eval("articleId") %>' runat="server" />
<asp:CheckBox ID="CheckBox1" runat="server" /> </ItemTemplate> </asp:TemplateField>
<asp:TemplateField HeaderText="文章标题"> <EditItemTemplate>
<asp:TextBox ID="txtTitle" Text='<%# Eval("articleTitle") %>' runat="server"></asp:TextBox> </EditItemTemplate> <ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("articleTitle") %>'></asp:Label> </ItemTemplate> </asp:TemplateField>
<asp:TemplateField HeaderText="文章类型"> <EditItemTemplate>
<asp:DropDownList ID="ddlType" runat="server"> </asp:DropDownList> </EditItemTemplate> <ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%#
GetNameByTypeId(Convert.ToInt32( Eval("articleTypeId"))) %>'></asp:Label> </ItemTemplate> </asp:TemplateField>
<asp:CommandField ShowEditButton="True" /> </Columns> </asp:GridView>
上一篇:音频技术与应用发展趋势
下一篇:小学科学课外活动记录表