91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

FormView的插入模板中的DropDownList控件參數

發布時間:2020-06-30 02:19:26 來源:網絡 閱讀:666 作者:chul72 欄目:編程語言

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <p>控件SqlDataSource與FormViw應用之在插入模板添加控件DropDwonList并保存記錄實例</p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:HRM_DATAConnectionString %>"
            SelectCommand="SELECT [CompanyID], [Company] FROM [tblCompany]">
        </asp:SqlDataSource>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
            DataKeyNames="CompanyID" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="CompanyID" HeaderText="CompanyID"
                    InsertVisible="False" ReadOnly="True" SortExpression="CompanyID" />
                <asp:BoundField DataField="Company" HeaderText="Company"
                    SortExpression="Company" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server"
            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)">
            <InsertParameters>
                <asp:Parameter Name="Depart" />
                <asp:Parameter Name="CompanyID" />
            </InsertParameters>
            <SelectParameters>
                <asp:ControlParameter ControlID="GridView1" Name="Companyid"
                    PropertyName="SelectedValue" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:FormView ID="FormView1" runat="server" AllowPaging="True"
            BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
            CellPadding="4" DataKeyNames="DepartID" DataSourceID="SqlDataSource2"
            GridLines="Both" Height="125px" Width="566px">
            <EditItemTemplate>
                DepartID:
                <asp:Label ID="DepartIDLabel1" runat="server" Text='<%# Eval("DepartID") %>' />
                <br />
                Depart:
                <asp:TextBox ID="DepartTextBox" runat="server" Text='<%# Bind("Depart") %>' />
                <br />
                Company:
                <asp:TextBox ID="CompanyTextBox" runat="server" Text='<%# Bind("Company") %>' />
                <br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
                    CommandName="Update" Text="更新" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
                    CausesValidation="False" CommandName="Cancel" Text="取消" />
            </EditItemTemplate>
            <EditRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
            <InsertItemTemplate>
                Depart:
                <asp:TextBox ID="DepartTextBox" runat="server" Text='<%# Bind("Depart") %>' />
                <br />
                Company:
                <asp:DropDownList ID="DropDownList1" runat="server"
                    DataSourceID="SqlDataSource1" DataTextField="Company"
                    DataValueField="CompanyID" SelectedValue='<%# Bind("CompanyID") %>'>
                </asp:DropDownList>
                <br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
                    CommandName="Insert" Text="插入" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server"
                    CausesValidation="False" CommandName="Cancel" Text="取消" />
            </InsertItemTemplate>
            <ItemTemplate>
                DepartID:
                <asp:Label ID="DepartIDLabel" runat="server" Text='<%# Eval("DepartID") %>' />
                <br />
                Depart:
                <asp:Label ID="DepartLabel" runat="server" Text='<%# Bind("Depart") %>' />
                <br />

                Company:
                <asp:Label ID="CompanyLabel" runat="server" Text='<%# Bind("Company") %>' />
                <br />
                <br />
                <br />
                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="New">New</asp:LinkButton>
            </ItemTemplate>
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <RowStyle BackColor="White" ForeColor="#330099" />
        </asp:FormView>
        <br />
        <br />


    </div>
    </form>
</body>
</html>


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

汝阳县| 湖州市| 上杭县| 分宜县| 万荣县| 西充县| 土默特右旗| 安化县| 天柱县| 古蔺县| 都江堰市| 柯坪县| 盐城市| 余姚市| 萝北县| 漳平市| 依安县| 中宁县| 丹江口市| 汝城县| 榆社县| 万全县| 台中县| 钟祥市| 孟连| 柘荣县| 台南市| 东宁县| 毕节市| 扬州市| 荆州市| 隆德县| 临汾市| 望江县| 西林县| 什邡市| 类乌齐县| 永靖县| 宜良县| 盐源县| 雷州市|