Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value indicating whether controls on the page can have custom attributes defined. The default value is the value of the allowCustomAttributes
attribute of the <mobilecontrols
> section of the Web.config file. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.
public:
property bool AllowCustomAttributes { bool get(); void set(bool value); };
[System.ComponentModel.Bindable(false)]
[System.ComponentModel.Browsable(false)]
public bool AllowCustomAttributes { get; set; }
[<System.ComponentModel.Bindable(false)>]
[<System.ComponentModel.Browsable(false)>]
member this.AllowCustomAttributes : bool with get, set
Public Property AllowCustomAttributes As Boolean
true
if the controls on the page can have custom attributes defined; otherwise, false
.
In addition to the IAttributeAccessor interface, the ASP.NET page framework provides a CustomAttributes
dictionary that allows you to specify additional attributes, enable or disable custom attributing, or adjust a control's behavior or rendering. To enable or disable custom attributing, you can either set the AllowCustomAttributes property to true
, or you can set the allowCustomAttributes
attribute of the <mobileControls>
section of Web.config to true
.
Note
When custom attributes are enabled, typographic errors in property names can be interpreted as custom attributes. For example, if a developer incorrectly specifies the Text property of a control as "Txet", the parser would save it as a custom attribute called "Txet" instead of raising an exception. For this reason, custom attributes are disabled by default.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in