首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 編程語言 >  >> .NET 網頁程式設計 >> ASP.NET 基礎 >> 關於ASP.NET

ASP.NET 控制項設計時支援 (3) - 智慧標籤

     編輯:關於ASP.NET

智慧標籤介紹

控制項右上角的小三角箭頭展開的工作清單即為智慧標籤,可快速設定常用屬性 (如 GridView 的分頁、排序)。

GridView 智慧標籤

實作步驟

  1. 建立自訂 DesignerActionList 衍生類別,定義要顯示的動作項目。
  2. 覆寫 ControlDesigner.ActionLists 屬性,回傳包含自訂 ActionList 的 DesignerActionListCollection。

程式碼範例

public class SampleControlDesigner : ControlDesigner {
    public override DesignerActionListCollection ActionLists {
        get {
            DesignerActionListCollection actionLists = new DesignerActionListCollection();
            actionLists.Add(new CustomControlActionList(this));
            return actionLists;
        }
    }
}

效果

開發者在設計介面點選控制項即可看到自訂的智慧標籤,大幅提升設定效率。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved