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>

  • 相关阅读:
    DI的3种实现方式
    spring ioc的实现方式
    异常:This application has no explicit mapping for /error, so you are seeing this as a fallback.
    maven项目 集成SSM框架
    org.xml.sax.SAXParseException错误
    Redis在web中的应用
    上传下载文件实例(vsftp服务器+nginx)
    Redis的安装与启动
    修饰器-2
    修饰器练习
  • 原文地址:https://www.cnblogs.com/fjchenq/p/528064.html
Copyright © 2011-2022 走看看