自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

在DataBound事件處理中編碼確定數(shù)據(jù)的值

開發(fā) 后端
本文簡單介紹了如何在DataBound 事件處理中編碼確定數(shù)據(jù)的值。

當FormView的標記完成后,下一步就是確定UnitsInStock的值是否小于等于10,這里和在DetailView中類似,先創(chuàng)建DataBound事件

創(chuàng)建 DataBound 事件處理 

圖: 創(chuàng)建 DataBound 事件處理

在事件中聲明FormView的DataItem屬性到ProductsRow實例中,確定UnitsInPrice的值并將對應的值用紅色字體顯示

  1. protected void LowStockedProductsInRed_DataBound(object sender, EventArgs e)  
  2.  
  3. {  
  4.  
  5.     // Get the ProductsRow object from the DataItem property...  
  6.  
  7.     Northwind.ProductsRow product = (Northwind.ProductsRow)((System.Data.DataRowView)LowStockedProductsInRed.DataItem).Row;  
  8.  
  9.     if (!product.IsUnitsInStockNull() && product.UnitsInStock < = 10)  
  10.  
  11.     {  
  12.  
  13.         // TODO: Make the UnitsInStockLabel’s text red  
  14.  
  15.     }  
  16.  
  17. }  
  18.  

這樣就實現(xiàn)了在DataBound事件處理中編碼確定數(shù)據(jù)的值。

【編輯推薦】

  1. ASP.NET 2.0數(shù)據(jù)教程:SelectMethod屬性的使用
  2. ASP.NET 2.0數(shù)據(jù)教程:在業(yè)務邏輯層添加方法
  3. ASP.NET 2.0數(shù)據(jù)教程:為TableAdapter添加方法
  4. ASP.NET 2.0數(shù)據(jù)教程:使用一個硬編碼參數(shù)值
  5. ASP.NET 2.0數(shù)據(jù)教程:綁定到ObjectDataSource
責任編輯:book05 來源: 博客堂
相關(guān)推薦

2009-07-27 16:42:16

DataBound

2009-07-28 03:43:00

RowDataBoun

2016-01-22 11:05:07

2009-06-14 17:53:25

ibmdwWebSphere

2013-05-15 15:30:02

數(shù)據(jù)中心綜合布線

2015-07-20 11:12:43

數(shù)據(jù)中心數(shù)據(jù)中心建設(shè)

2023-12-07 19:00:25

數(shù)據(jù)科學機器學習數(shù)據(jù)可視化

2017-12-27 14:22:07

數(shù)據(jù)中心負載成本

2023-10-04 00:01:00

sizeofC 語言

2017-03-14 13:51:23

AndroidView事件分發(fā)和處理

2010-03-23 14:34:44

Python vim檢

2016-04-29 10:02:39

2011-06-16 14:23:43

JavaScript空事件處理程序

2011-04-01 14:14:42

SQL Server空值

2009-07-28 08:24:16

GridView綁定數(shù)

2021-02-06 10:27:45

C#函數(shù)參數(shù)

2013-12-25 10:08:42

ember.js異步處理

2010-05-31 15:23:02

MySQL數(shù)據(jù)庫NUL

2010-04-28 18:25:51

Oracle數(shù)據(jù)庫

2020-09-25 11:10:51

運維故障排查監(jiān)控
點贊
收藏

51CTO技術(shù)棧公眾號