<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
        主站蜘蛛池模板: 噜噜嘿在线视频免费观看| 日本亚洲欧洲免费天堂午夜看片女人员| 亚洲一区二区三区国产精品| 亚洲人成影院在线观看 | 国产美女a做受大片免费| 亚洲欧洲日韩极速播放| 免费无码黄十八禁网站在线观看 | 久草免费在线观看视频| 亚洲日本香蕉视频观看视频| 特级无码毛片免费视频| 亚洲精品偷拍视频免费观看| www成人免费观看网站| 成人免费激情视频| 亚洲天堂一区二区三区| www.黄色免费网站| 亚洲视频在线一区| 亚洲AV电影天堂男人的天堂| 日本免费在线观看| 亚洲黄网在线观看| 成人免费无码大片A毛片抽搐色欲 成人免费无码大片a毛片 | 成人毛片免费播放| 久久亚洲欧美国产精品| 亚洲国产精品一区二区三区久久| 精品一区二区三区免费视频| 亚洲AV无码成人精品区天堂| 全部在线播放免费毛片| 亚洲国产精品无码AAA片| 无码AV动漫精品一区二区免费| 大学生美女毛片免费视频| 杨幂最新免费特级毛片| 亚洲AV无码久久精品成人 | www在线观看免费视频| 亚洲一区精品中文字幕| 成人一区二区免费视频| 一级毛片直播亚洲| 毛片免费在线观看| 亚洲一卡二卡三卡| 国产免费女女脚奴视频网| 久久亚洲中文无码咪咪爱| 亚洲开心婷婷中文字幕| 成人免费a级毛片|