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

ASP.NET組件設計學習之創(chuàng)建工程庫

開發(fā) 后端
ASP.NET組件設計學習之創(chuàng)建工程庫是如何實現(xiàn)的呢?ASP.NET組件設計的學習是什么步驟呢?本文ASP.NET組件設計學習之創(chuàng)建工程庫就向你介紹這方面的內(nèi)容。

ASP.NET組件設計學習之創(chuàng)建工程庫是如何的呢?讓我們開始吧:

學習創(chuàng)建工程庫、在自己的項目中應用

ASP.NET組件設計學習之創(chuàng)建工程庫1、 啟動VS200X

ASP.NET組件設計學習之創(chuàng)建工程庫2、 選擇新建解決方案

ASP.NET組件設計學習之創(chuàng)建工程庫3、 選擇缺省的方案類型,選擇 Web控件庫。Web控件庫不需要web站點,基本上是一個DLL類型庫

ASP.NET組件設計學習之創(chuàng)建工程庫4、 輸入自己的類型庫的名稱,譬如ASPCTLLib之類的。這個決定了namespace和以后其他工程使用此庫的引用庫名。

ASP.NET組件設計學習之創(chuàng)建工程庫5、 系統(tǒng)自動產(chǎn)生的代碼如下:

  1. using System;  
  2.  
  3. using System.Web.UI;  
  4.  
  5. using System.Web.UI.WebControls;  
  6.  
  7. using System.ComponentModel;  
  8.  
  9. namespace ASPCtlLib  
  10.  
  11. {  
  12.  
  13.      /// ﹤summary﹥  
  14.  
  15.      /// WebCustomControl1 的摘要說明。  
  16.  
  17.      /// ﹤/summary﹥  
  18.  
  19.      [DefaultProperty("Text"),  
  20.  
  21.           ToolboxData("﹤{0}:WebCustomControl1 runat=server﹥﹤/{0}:WebCustomControl1﹥")]  
  22.  
  23.      public class WebCustomControl1 : System.Web.UI.WebControls.WebControl  
  24.  
  25.      {  
  26.  
  27.           private string text;  
  28.  
  29.           [Bindable(true),  
  30.  
  31.               Category("Appearance"),  
  32.  
  33.               DefaultValue("")]  
  34.  
  35.          public string Text  
  36.  
  37.          {  
  38.  
  39.               get  
  40.  
  41.               {  
  42.  
  43.                    return text;  
  44.  
  45.               }  
  46.  
  47.               set  
  48.  
  49.               {  
  50.  
  51.                    text = value;  
  52.  
  53.               }  
  54.  
  55.          }  
  56.  
  57.    
  58.  
  59.          /// ﹤summary﹥  
  60.  
  61.          /// 將此控件呈現(xiàn)給指定的輸出參數(shù)。  
  62.  
  63.          /// ﹤/summary﹥  
  64.  
  65.          /// ﹤param name="output"﹥ 要寫出到的 HTML 編寫器 ﹤/param﹥  
  66.  
  67.           protected override void Render(HtmlTextWriter output)  
  68.  
  69.          {  
  70.  
  71.               output.Write(Text);  
  72.  
  73.          }  
  74.  
  75.      }  
  76.  

ASP.NET組件設計學習之創(chuàng)建工程庫6、 AssemblyInfo.cs的介紹

ASP.NET組件設計學習之創(chuàng)建工程庫7、 編譯此工程得到ASPCTLLIb.dll

ASP.NET組件設計學習之創(chuàng)建工程庫8、 其他項目引用

如何引用自己建立的Web控件庫

1、 打開/新建一個asp.net項目

2、 引用ASPCTLLib.dll,將會在引用中出現(xiàn)aspctllib,同時將之前的dll文件復制到當前工程的目錄

3、 將自己的Web控件庫中控件加入toolbar的選項卡:右擊選項卡,自定義工具箱,選擇.net框架組件,瀏覽,找到aspctllib.dll加入,即可看到名為WebCustomControl1的組件存在于工具箱

4、 打開自己的aps.net web 項目,選擇一個web窗體,可以將自己的控件加入到其中。缺省的設計時此控件會顯示:[WebCustomControl1 ” WebCustomControl1”]。

5、 選中窗體中的此控件,打開屬性進行編輯,基本上缺省的設計控件僅有一個Text屬性屬于定制屬性,輸入特定文字。

6、 編譯,瀏覽察看效果。

ASP.NET組件設計學習之創(chuàng)建工程庫的步驟就向你介紹到這里,希望對你學習ASP.NET組件設計之創(chuàng)建工程庫有所了解。

【編輯推薦】

  1. ASP.NET控件設計時支持之自動格式設置淺析
  2. ASP.NET控件設計時操作列表與模板編輯淺析
  3. ASP.NET控件設計器淺析
  4. ASP.NET組件設計淺談
  5. ASP.NET組件設計之ASP.NET Timer淺析
責任編輯:仲衡 來源: cnblogs
相關推薦

2009-08-10 14:08:15

ASP.NET服務器控ASP.NET組件設計

2009-08-10 13:32:15

ASP.NET TimASP.NET組件設計

2009-07-28 17:17:19

ASP.NET概述

2009-08-05 16:53:14

ASP.NET組件設計

2009-08-10 10:19:47

ASP.NET組件設計

2009-08-10 14:38:29

ASP.NET組件設計

2009-08-10 14:31:46

ASP.NET組件設計ASP.NET控件生命

2009-08-05 16:59:55

ASP.NET組件設計

2009-07-29 13:57:53

創(chuàng)建SlideShowASP.NET

2009-07-23 14:21:55

ASP.NET頁面

2023-07-04 08:26:15

2009-07-23 14:31:20

ASP.NET MVC

2009-08-03 13:38:18

ASP.NET編程模型

2009-07-29 10:06:21

如何學習ASP.NET

2009-08-10 16:14:26

ASP.NET安裝部署

2009-07-27 17:15:51

URL RewriteASP.NET

2009-07-31 13:06:53

CheckBoxLisASP.NET頁面

2009-08-10 15:42:33

ASP.NET Che

2009-08-10 16:07:44

ASP.NET Lin

2009-08-17 09:24:25

ASP.NET控件
點贊
收藏

51CTO技術棧公眾號