语言

PageParserFilter.AllowControl(Type, ControlBuilder) 方法

定义

获取一个值,该值指示是否允许此页使用指定的控件类型。

public:
 virtual bool AllowControl(Type ^ controlType, System::Web::UI::ControlBuilder ^ builder);
public virtual bool AllowControl(Type controlType, System.Web.UI.ControlBuilder builder);
abstract member AllowControl : Type * System.Web.UI.ControlBuilder -> bool
override this.AllowControl : Type * System.Web.UI.ControlBuilder -> bool
Public Overridable Function AllowControl (controlType As Type, builder As ControlBuilder) As Boolean

参数

controlType
Type

一个 Type 表示要添加的控件的类型。

builder
ControlBuilder

ControlBuilder用于生成指定类型的控件。

返回

true 如果控件可与当前页一起使用,则为否则,为 false. 默认值为 false。

注解

该 TemplateParser 类检查是否允许在分析时在页面中使用控件。 AllowControl重写方法以拒绝或允许页面中的特定控件。

适用于