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>

  • 相关阅读:
    java中Collections.sort() 排序函数的用法
    [SDOI2017]数字表格
    [SDOI2008]洞穴勘测
    How to copy a file from xp to linux?
    A java class
    Linux Mysql Charset utf8
    Linux environment variables
    get vars from url or request
    你在视网膜技术上太逊了,快来补充知识吧! java程序员
    Activity消息传递与消息回传模板 java程序员
  • 原文地址:https://www.cnblogs.com/fjchenq/p/528064.html
Copyright © 2011-2022 走看看