濮阳杆衣贸易有限公司

主頁 > 知識(shí)庫 > ASP.NET中ListView(列表視圖)的使用前臺(tái)綁定附源碼

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

熱門標(biāo)簽:電話機(jī)器人軟件銷售工作 蘋果手機(jī)凱立德地圖標(biāo)注 玉林市機(jī)器人外呼系統(tǒng)哪家好 同安公安400電話怎么申請(qǐng)流程 申請(qǐng)400電話手續(xù) 百度ai地圖標(biāo)注 預(yù)測(cè)式外呼系統(tǒng)使用說明 合肥電銷外呼系統(tǒng)哪家公司做的好 南陽外呼系統(tǒng)定制化
1.A,運(yùn)行效果圖

 

1.B,源代碼
復(fù)制代碼 代碼如下:

%@ 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>無標(biāo)題頁/title>
/head>
body>
form id="form1" runat="server">
div>
請(qǐng)選擇大分類: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 />
該分類下的產(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>
nbsp;/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
復(fù)制代碼 代碼如下:

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

1.C,資源下載
您可能感興趣的文章:
  • android二級(jí)listview列表實(shí)現(xiàn)代碼
  • Android通過LIstView顯示文件列表的兩種方法介紹
  • Android ExpandableListView展開列表控件使用實(shí)例
  • android開發(fā)教程之使用listview顯示qq聯(lián)系人列表
  • Android用ListView顯示SDCard文件列表的小例子
  • pp列表之分組ListView詳解
  • Android編程使用ListView實(shí)現(xiàn)數(shù)據(jù)列表顯示的方法
  • Android開發(fā)之ListView列表刷新和加載更多實(shí)現(xiàn)方法
  • listview控件實(shí)現(xiàn)點(diǎn)擊列表頭進(jìn)行l(wèi)istview排序示例分享
  • Android ListView實(shí)現(xiàn)簡單列表功能

標(biāo)簽:揚(yáng)州 嘉興 南京 臺(tái)州 南京 南昌 海南 淄博

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ASP.NET中ListView(列表視圖)的使用前臺(tái)綁定附源碼》,本文關(guān)鍵詞  ASP.NET,中,ListView,列表,視圖,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《ASP.NET中ListView(列表視圖)的使用前臺(tái)綁定附源碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于ASP.NET中ListView(列表視圖)的使用前臺(tái)綁定附源碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    龙南县| 新郑市| 合山市| 丹东市| 临安市| 桐乡市| 蒲城县| 甘肃省| 绥宁县| 宁武县| 九寨沟县| 冕宁县| 合肥市| 兴和县| 黔南| 怀集县| 雷山县| 双城市| 阿克苏市| 临江市| 镇远县| 晋宁县| 固安县| 农安县| 濮阳县| 郑州市| 沙洋县| 湘潭县| 郓城县| 遂平县| 南召县| 肇源县| 木兰县| 清涧县| 当阳市| 阳泉市| 民丰县| 南投市| 浦县| 罗山县| 九龙坡区|