zoukankan      html  css  js  c++  java
  • GridView、DetailView、FormView和DropDownList级联更新和插入(不用FindControl)

     <asp:TemplateField HeaderText="类别" SortExpression="CategoryName">
            <EditItemTemplate>
            <asp:DropDownList ID="CategoryDDL2" runat="server" Width="180px" 
                      SelectedValue='<%# Bind("CategoryID") %>'
                      DataSourceID="CategoryDS" 
                      DataTextField="CategoryName" DataValueField="CategoryID"
    >
            </asp:DropDownList>                   
             </EditItemTemplate>
                   <InsertItemTemplate>
                       <asp:DropDownList ID="CategoryDDL3" runat="server" Width="180px" 
                               SelectedValue='<%# Bind("CategoryID") %>'     DataSourceID="CategoryDS" 
                               DataTextField="CategoryName" DataValueField="CategoryID">

                        </asp:DropDownList>
                   </InsertItemTemplate>
                   <ItemTemplate>
                       <asp:Label ID="Label1" runat="server" Text='<%# Bind("CategoryName") %>'>
                       </asp:Label>
                   </ItemTemplate>



              <UpdateParameters>
                    <asp:Parameter Name="LessonID" Type="Int32" />
                    <asp:Parameter Name="CategoryID" Type="Int32" />
                    <asp:Parameter Name="LessonName" Type="String" />
                </UpdateParameters>
                <InsertParameters>
                   <asp:Parameter Name="CategoryID" Type="Int32" />
                    <asp:Parameter Name="LessonName" Type="String" />
                 </InsertParameters>

  • 相关阅读:
    MySQL-第十四篇事务管理
    MySQL-第十三篇使用ResultSetMetaData分析结果集
    MySQL-第十二篇管理结果集
    MySQL-第十一篇JDBC典型用法
    MySQL-第十篇多表连接查询
    Java中List集合去除重复数据的方法1
    去除List集合中的重复值(四种好用的方法)(基本数据类型可用)
    去除list集合中重复项的几种方法
    Java中List集合去除重复数据的四种方法
    Java中List集合去除重复数据的方法
  • 原文地址:https://www.cnblogs.com/fjchenq/p/528064.html
Copyright © 2011-2022 走看看