FormView的插入模板中的DropDownList控件参数

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

建网站原本是网站策划师、网络程序员、网页设计师等,应用各种网络程序开发技术和网页设计技术配合操作的协同工作。创新互联专业提供网站制作、成都做网站,网页设计,网站制作(企业站、自适应网站建设、电商门户网站)等服务,从网站深度策划、搜索引擎友好度优化到用户体验的提升,我们力求做到极致!




   


   


   

   

控件SqlDataSource与FormViw应用之在插入模板添加控件DropDwonList并保存记录实例


                    SelectCommand="SELECT [CompanyID], [Company] FROM [tblCompany]">
       

                    DataKeyNames="CompanyID" DataSourceID="SqlDataSource1">
           
               
                                    InsertVisible="False" ReadOnly="True" SortExpression="CompanyID" />
                                    SortExpression="Company" />
           

       

                    ConnectionString="<%$ ConnectionStrings:HRM_DATAConnectionString %>"
            InsertCommand="INSERT INTO tblDepart(Depart, CompanyID) VALUES (@Depart,@CompanyID)"
            SelectCommand="SELECT tblDepart.DepartID, tblDepart.Depart, tblCompany.Company, tblDepart.CompanyID FROM tblDepart INNER JOIN tblCompany ON tblDepart.CompanyID = tblCompany.CompanyID WHERE (tblCompany.CompanyID = @Companyid)">
           
               
               
           

           
                                    PropertyName="SelectedValue" />
           

       

                    BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
            CellPadding="4" DataKeyNames="DepartID" DataSourceID="SqlDataSource2"
            GridLines="Both" Height="125px" Width="566px">
           
                DepartID:
               
               

                Depart:
               
               

                Company:
               
               

                                    CommandName="Update" Text="更新" />
                                     CausesValidation="False" CommandName="Cancel" Text="取消" />
           

           
           
           
           
                Depart:
               
               

                Company:
                                    DataSourceID="SqlDataSource1" DataTextField="Company"
                    DataValueField="CompanyID" SelectedValue='<%# Bind("CompanyID") %>'>
               

               

                                    CommandName="Insert" Text="插入" />
                                     CausesValidation="False" CommandName="Cancel" Text="取消" />
           

           
                DepartID:
               
               

                Depart:
               
               

                Company:
               
               

               

               

                New
           
           
           
       
       

       


   


   



名称栏目:FormView的插入模板中的DropDownList控件参数
分享链接:http://azwzsj.com/article/peoedj.html