MobilePage.AllowCustomAttributes Property

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.

Namespace: System.Web.UI.MobileControls
Assembly: System.Web.Mobile (in system.web.mobile.dll)

[BindableAttribute(false)] 
public:
property bool AllowCustomAttributes {
	bool get ();
	void set (bool value);
}
/** @property */
public boolean get_AllowCustomAttributes ()

/** @property */
public void set_AllowCustomAttributes (boolean value)

public function get AllowCustomAttributes () : boolean

public function set AllowCustomAttributes (value : boolean)

Not applicable.

Property Value

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.

NoteNote:

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.

The following example demonstrates how to use the AllowCustomAttributes property to enable the custom AccessKey attribute on the Command.

NoteNote:

The following code sample uses the single-file code model and may not work correctly if you copy it directly into a code-behind file. You must copy this code sample into an empty text file that has an .aspx extension. For more information, see ASP.NET Web Page Code Model.

No code example is currently available or this language may not be supported.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1

Community Additions

ADD
Show: