• <fieldset id="8imwq"><menu id="8imwq"></menu></fieldset>
  • <bdo id="8imwq"><input id="8imwq"></input></bdo>
    最新文章專(zhuān)題視頻專(zhuān)題問(wèn)答1問(wèn)答10問(wèn)答100問(wèn)答1000問(wèn)答2000關(guān)鍵字專(zhuān)題1關(guān)鍵字專(zhuān)題50關(guān)鍵字專(zhuān)題500關(guān)鍵字專(zhuān)題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關(guān)鍵字專(zhuān)題關(guān)鍵字專(zhuān)題tag2tag3文章專(zhuān)題文章專(zhuān)題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專(zhuān)題3
    問(wèn)答文章1 問(wèn)答文章501 問(wèn)答文章1001 問(wèn)答文章1501 問(wèn)答文章2001 問(wèn)答文章2501 問(wèn)答文章3001 問(wèn)答文章3501 問(wèn)答文章4001 問(wèn)答文章4501 問(wèn)答文章5001 問(wèn)答文章5501 問(wèn)答文章6001 問(wèn)答文章6501 問(wèn)答文章7001 問(wèn)答文章7501 問(wèn)答文章8001 問(wèn)答文章8501 問(wèn)答文章9001 問(wèn)答文章9501
    當(dāng)前位置: 首頁(yè) - 科技 - 知識(shí)百科 - 正文

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

    來(lái)源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-27 22:41:36
    文檔

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

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

    1.A,運(yùn)行效果圖

     

    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>無(wú)標(biāo)題頁(yè)</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    請(qǐng)選擇大分類(lèi):<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 />
    該分類(lèi)下的產(chǎn)品:<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>
    未返回?cái)?shù)據(jù)。</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,資源下載

    聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

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

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

    最新推薦

    猜你喜歡

    熱門(mén)推薦

    專(zhuān)題
    Top
    主站蜘蛛池模板: 亚洲国产精品成人久久蜜臀| 亚洲精品二区国产综合野狼 | 国产欧美精品一区二区色综合 | 精品国产美女福利到在线不卡| 亚洲国产成人久久精品99| 久久精品国产亚洲麻豆| 久久精品国产亚洲AV高清热| 日韩欧美一区二区三区中文精品| 99久久综合国产精品二区| 99精品无人区乱码在线观看| 亚洲国产小视频精品久久久三级| 国产精品毛片一区二区| 欧美精品亚洲精品日韩| 国产精品毛片VA一区二区三区| 亚洲AV午夜福利精品一区二区| 四虎永久在线精品免费一区二区| 国产美女精品视频| 国产精品1024视频| 91av国产精品| 欧美精品人爱c欧美精品| 精品国产综合成人亚洲区| 国产AV无码专区亚洲精品| 欧洲成人午夜精品无码区久久| 亚洲精品tv久久久久久久久久| 精品无人区无码乱码毛片国产| 国产成人综合精品一区| 91精品免费久久久久久久久| 亚洲精品在线观看视频| 日本精品久久久中文字幕| 精品国产欧美一区二区| 精品九九人人做人人爱| 九九精品成人免费国产片| 69SEX久久精品国产麻豆| 国产精品视频白浆免费视频 | 500av大全导航精品| 国产成人精品无码免费看| 精品卡一卡二卡乱码高清| 国产日韩精品中文字无码| 成人精品在线视频| 国产精品一国产精品| 日韩精品一区二区三区在线观看|