<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        ASP.NET中ListView(列表視圖)的使用前臺綁定附源碼

        來源:懂視網 責編:小采 時間:2020-11-27 22:41:36
        文檔

        ASP.NET中ListView(列表視圖)的使用前臺綁定附源碼

        ASP.NET中ListView(列表視圖)的使用前臺綁定附源碼:1.A,運行效果圖 1.B,源代碼 代碼如下:<%@ Page Language=C# AutoEventWireup=true CodeFile=DropLvw.aspx.cs Inherits=DropLvw %> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
        推薦度:
        導讀ASP.NET中ListView(列表視圖)的使用前臺綁定附源碼:1.A,運行效果圖 1.B,源代碼 代碼如下:<%@ Page Language=C# AutoEventWireup=true CodeFile=DropLvw.aspx.cs Inherits=DropLvw %> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0

        1.A,運行效果圖

         

        1.B,源代碼
        代碼如下:


        <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DropLvw.aspx.cs" Inherits="DropLvw" %>

        <!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>
        請選擇大分類:<asp:DropDownList ID="drop" runat="server" AutoPostBack="True"
        DataSourceID="SqlDataSource1" DataTextField="CategoryName"
        DataValueField="CategoryID">
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT [CategoryID], [CategoryName] FROM [Categories]">
        </asp:SqlDataSource>
        <hr />
        該分類下的產品:<br />
        <asp:ListView ID="lvw" runat="server" DataKeyNames="ProductID"
        DataSourceID="SqlDataSource2">
        <ItemTemplate>
        <tr style="">
        <td>
        <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>' />
        </td>
        <td>
        <asp:Label ID="ProductNameLabel" runat="server"
        Text='<%# Eval("ProductName") %>' />
        </td>
        <td>
        <asp:Label ID="CategoryIDLabel" runat="server"
        Text='<%# Eval("CategoryID") %>' />
        </td>
        <td>
        <asp:Label ID="UnitPriceLabel" runat="server" Text='<%# Eval("UnitPrice") %>' />
        </td>
        </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
        <tr style="">
        <td>
        <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>' />
        </td>
        <td>
        <asp:Label ID="ProductNameLabel" runat="server"
        Text='<%# Eval("ProductName") %>' />
        </td>
        <td>
        <asp:Label ID="CategoryIDLabel" runat="server"
        Text='<%# Eval("CategoryID") %>' />
        </td>
        <td>
        <asp:Label ID="UnitPriceLabel" runat="server" Text='<%# Eval("UnitPrice") %>' />
        </td>
        </tr>
        </AlternatingItemTemplate>
        <EmptyDataTemplate>
        <table runat="server" style="">
        <tr>
        <td>
        未返回數據。</td>
        </tr>
        </table>
        </EmptyDataTemplate>
        <InsertItemTemplate>
        <tr style="">
        <td>
        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="插入" />
        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="清除" />
        </td>
        <td>
         </td>
        <td>
        <asp:TextBox ID="ProductNameTextBox" runat="server"
        Text='<%# Bind("ProductName") %>' />
        </td>
        <td>
        <asp:TextBox ID="CategoryIDTextBox" runat="server"
        Text='<%# Bind("CategoryID") %>' />
        </td>
        <td>
        <asp:TextBox ID="UnitPriceTextBox" runat="server"
        Text='<%# Bind("UnitPrice") %>' />
        </td>
        </tr>
        </InsertItemTemplate>
        <LayoutTemplate>
        <table runat="server">
        <tr runat="server">
        <td runat="server">
        <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
        <tr runat="server" style="">
        <th runat="server">
        ProductID</th>
        <th runat="server">
        ProductName</th>
        <th runat="server">
        CategoryID</th>
        <th runat="server">
        UnitPrice</th>
        </tr>
        <tr ID="itemPlaceholder" runat="server">
        </tr>
        </table>
        </td>
        </tr>
        <tr runat="server">
        <td runat="server" style="">
        </td>
        </tr>
        </table>
        </LayoutTemplate>
        <EditItemTemplate>
        <tr style="">
        <td>
        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="更新" />
        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="取消" />
        </td>
        <td>
        <asp:Label ID="ProductIDLabel1" runat="server"
        Text='<%# Eval("ProductID") %>' />
        </td>
        <td>
        <asp:TextBox ID="ProductNameTextBox" runat="server"
        Text='<%# Bind("ProductName") %>' />
        </td>
        <td>
        <asp:TextBox ID="CategoryIDTextBox" runat="server"
        Text='<%# Bind("CategoryID") %>' />
        </td>
        <td>
        <asp:TextBox ID="UnitPriceTextBox" runat="server"
        Text='<%# Bind("UnitPrice") %>' />
        </td>
        </tr>
        </EditItemTemplate>
        <SelectedItemTemplate>
        <tr style="">
        <td>
        <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ProductID") %>' />
        </td>
        <td>
        <asp:Label ID="ProductNameLabel" runat="server"
        Text='<%# Eval("ProductName") %>' />
        </td>
        <td>
        <asp:Label ID="CategoryIDLabel" runat="server"
        Text='<%# Eval("CategoryID") %>' />
        </td>
        <td>
        <asp:Label ID="UnitPriceLabel" runat="server" Text='<%# Eval("UnitPrice") %>' />
        </td>
        </tr>
        </SelectedItemTemplate>
        </asp:ListView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server"
        ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT [ProductID], [ProductName], [CategoryID], [UnitPrice] FROM [Products] WHERE ([CategoryID] = @CategoryID)">
        <SelectParameters>
        <asp:ControlParameter ControlID="drop" DefaultValue="1" Name="CategoryID"
        PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
        </asp:SqlDataSource>
        </div>
        </form>
        </body>
        </html>

        /web.config
        代碼如下:


        <connectionStrings>
        <add name="NorthwindConnectionString" connectionString="Data
        Source=.;Initial Catalog=Northwind;Integrated Security=True"
        providerName="System.Data.SqlClient"/>
        </connectionStrings>

        1.C,資源下載

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        ASP.NET中ListView(列表視圖)的使用前臺綁定附源碼

        ASP.NET中ListView(列表視圖)的使用前臺綁定附源碼:1.A,運行效果圖 1.B,源代碼 代碼如下:<%@ Page Language=C# AutoEventWireup=true CodeFile=DropLvw.aspx.cs Inherits=DropLvw %> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
        推薦度:
        標簽: 源代碼 asp listview
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 亚洲av无码片区一区二区三区| 国产av无码专区亚洲av桃花庵| 亚洲嫩草影院在线观看| 久久久精品午夜免费不卡| 国产亚洲精品无码专区| 久久九九免费高清视频| 亚洲韩国精品无码一区二区三区| 精品国产污污免费网站入口| 国产亚洲精品影视在线产品| 两性色午夜视频免费播放| 综合久久久久久中文字幕亚洲国产国产综合一区首 | 久久青青草原亚洲av无码| 久久久久久久国产免费看| 久久乐国产精品亚洲综合| 国内精品一级毛片免费看| 91精品国产亚洲爽啪在线观看| 91久久成人免费| 亚洲色偷偷色噜噜狠狠99| 免费不卡中文字幕在线| 日韩a级无码免费视频| 99亚洲精品高清一二区| 成年女人男人免费视频播放 | 有码人妻在线免费看片| 久久亚洲国产中v天仙www| 18禁美女黄网站色大片免费观看| 亚洲精品在线电影| 日本高清免费不卡在线| 国产高潮久久免费观看| 亚洲一卡2卡三卡4卡有限公司| 91免费播放人人爽人人快乐| 99亚洲男女激情在线观看| 亚洲精品无码久久久影院相关影片| 99精品热线在线观看免费视频| 中文字幕无码亚洲欧洲日韩| 亚洲精品国产V片在线观看| 无码国产精品一区二区免费式芒果| 亚洲人成人77777网站不卡| 亚洲国产精品成人网址天堂| 亚洲精品免费视频| 国产亚洲精品美女久久久久| 久久精品夜色国产亚洲av|