资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

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://cdkjz.cn/article/peoedj.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220