Chinaunix首页 | 论坛 | 博客
  • 博客访问: 38066
  • 博文数量: 1
  • 博客积分: 206
  • 博客等级: 入伍新兵
  • 技术积分: 25
  • 用 户 组: 普通用户
  • 注册时间: 2005-05-28 12:55
文章分类
文章存档

2012年(1)

我的朋友
最近访客

分类: 嵌入式

2012-03-06 18:54:38

1:动态添加控件很简单,如:
  1. this.ToolBar1.DirectClick += new ComponentDirectEvent.DirectEventHandler(ToolBar1_DirectClick);
但需注意的,不能在Page_Load事件中不能将此行包含中如下代码中,否则会报以下错误:
The control 'fbtn_Insert' does not have an DirectEvent with the name 'Click' or the handler is absent
  1. if (!X.IsAjaxRequest)
  2. {
  3. //错误做法
  4.    this.ToolBar1.DirectClick += new ComponentDirectEvent.DirectEventHandler(ToolBar1_DirectClick);
  5.  }
或:
  1. if (IsPostBack)
  2. {
  3. //错误做法
  4.     this.ToolBar1.DirectClick += new ComponentDirectEvent.DirectEventHandler(ToolBar1_DirectClick);
  5. }

阅读(1479) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~