婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

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

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

熱門標簽:電話機器人軟件銷售工作 蘋果手機凱立德地圖標注 玉林市機器人外呼系統哪家好 同安公安400電話怎么申請流程 申請400電話手續 百度ai地圖標注 預測式外呼系統使用說明 合肥電銷外呼系統哪家公司做的好 南陽外呼系統定制化
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>
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
復制代碼 代碼如下:

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

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

標簽:揚州 嘉興 南京 臺州 南京 南昌 海南 淄博

巨人網絡通訊聲明:本文標題《ASP.NET中ListView(列表視圖)的使用前臺綁定附源碼》,本文關鍵詞  ASP.NET,中,ListView,列表,視圖,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《ASP.NET中ListView(列表視圖)的使用前臺綁定附源碼》相關的同類信息!
  • 本頁收集關于ASP.NET中ListView(列表視圖)的使用前臺綁定附源碼的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 太湖县| 灌阳县| 全南县| 怀集县| 越西县| 遂溪县| 绥滨县| 江山市| 刚察县| 漯河市| 甘孜县| 宾阳县| 天水市| 卓尼县| 深圳市| 澄江县| 武平县| 盘山县| 吉林省| 巩留县| 满洲里市| 嫩江县| 上栗县| 宝丰县| 陆丰市| 调兵山市| 长丰县| 洱源县| 乌拉特前旗| 天柱县| 奉新县| 平南县| 通河县| 卓资县| 确山县| 隆昌县| 满洲里市| 竹溪县| 鄂托克前旗| 沐川县| 积石山|