How to add HTML attributes to elements in the page....??
How to add HTML attributes to elements in the page....??
Properties of WebControl.Attributes :
It obtains the arbitrary collection of attributes that do not correspond to the properties of the control. If you using same as follows you will get nothing :
IEnumerator keys = Select.Attributes.Keys.GetEnumerator();
Because WebControl.Attributes is used only for representation, and is called by asp.net automaticly. You will not get the value at function.
WebControl.Attributes Property :
Gets the collection of arbitrary attributes (for rendering only) that do not correspond to properties on the control.
Syntax :
Code:Visual Basic (Declaration) : <BrowsableAttribute(False)> _ Public ReadOnly Property Attributes As AttributeCollectionCode:Visual Basic (Usage) : Dim instance As WebControl Dim value As AttributeCollection value = instance.AttributesCode:C# : [BrowsableAttribute(false)] public AttributeCollection Attributes { get; }Code:Visual C++ : [BrowsableAttribute(false)] public: property AttributeCollection^ Attributes { AttributeCollection^ get (); }Code:JScript : public function get Attributes () : AttributeCollection
AttributeCollection Class :
Represents a collection of attributes.
Syntax :
Code:Visual Basic (Declaration) : <ComVisibleAttribute(True)> _ <HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization := True)> _ Public Class AttributeCollection _ Implements ICollection, IEnumerableCode:Visual Basic (Usage) : Dim instance As AttributeCollectionCode:C# : [ComVisibleAttribute(true)] [HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true)] public class AttributeCollection : ICollection, IEnumerableCode:Visual C++ : [ComVisibleAttribute(true)] [HostProtectionAttribute(SecurityAction::LinkDemand, Synchronization = true)] public ref class AttributeCollection : ICollection, IEnumerableCode:JScript : public class AttributeCollection implements ICollection, IEnumerable
Bookmarks