偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

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

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

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

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

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

在事件中聲明FormView的DataItem屬性到ProductsRow實(shí)例中,確定UnitsInPrice的值并將對(duì)應(yīng)的值用紅色字體顯示

  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.  

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

【編輯推薦】

  1. ASP.NET 2.0數(shù)據(jù)教程:SelectMethod屬性的使用
  2. ASP.NET 2.0數(shù)據(jù)教程:在業(yè)務(wù)邏輯層添加方法
  3. ASP.NET 2.0數(shù)據(jù)教程:為TableAdapter添加方法
  4. ASP.NET 2.0數(shù)據(jù)教程:使用一個(gè)硬編碼參數(shù)值
  5. ASP.NET 2.0數(shù)據(jù)教程:綁定到ObjectDataSource
責(zé)任編輯:book05 來(lái)源: 博客堂
相關(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ù)科學(xué)機(jī)器學(xué)習(xí)數(shù)據(jù)可視化

2017-12-27 14:22:07

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

2017-03-14 13:51:23

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

2023-10-04 00:01:00

sizeofC 語(yǔ)言

2010-03-23 14:34:44

Python vim檢

2016-04-29 10:02:39

2021-02-06 10:27:45

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

2009-07-28 08:24:16

GridView綁定數(shù)

2011-06-16 14:23:43

JavaScript空事件處理程序

2011-04-01 14:14:42

SQL Server空值

2021-09-02 13:49:37

復(fù)雜事件處理CEP數(shù)據(jù)安全

2023-05-04 07:43:47

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

2010-05-31 15:23:02

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

2021-10-28 17:05:11

IT運(yùn)維故障
點(diǎn)贊
收藏

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