FormView的插入模板中的DropDownList控件参数-成都快上网建站

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控件参数
URL标题:http://kswjz.com/article/peoedj.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流