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中的继承
    jdk?jre?
    spring AOP的两种配置
    ng-repeat如何限制循环次数
    AngularJS filter:search 是如何匹配的 ng-repeat filter:search ,filter:{$:search},只取repeat的item的value 不含label
    Anjular的ng-repeat
    SpringBoot扫描不到类,注入失败A component required a bean of type 'XXService' that could...
    React路由安装使用和多种方式传参
    Vue详细介绍模板语法和过滤器的使用!
    Vue定义组件和生命周期函数及实例演示!
  • 原文地址:https://www.cnblogs.com/fjchenq/p/528064.html
Copyright © 2011-2022 走看看