Results 1 to 4 of 4

Thread: How to set HTML Tag Attribute in asp.net

  1. #1
    Join Date
    Mar 2009
    Posts
    55

    How to set HTML Tag Attribute in asp.net

    How to add HTML attributes to elements in the page....??

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: How to set HTML Tag Attribute in asp.net

    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.

  3. #3
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How to set HTML Tag Attribute in asp.net

    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 AttributeCollection
    Code:
    Visual Basic (Usage) :
    
    Dim instance As WebControl
    Dim value As AttributeCollection
    
    value = instance.Attributes
    Code:
    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

  4. #4
    Join Date
    May 2008
    Posts
    2,012

    Re: How to set HTML Tag Attribute in asp.net

    AttributeCollection Class :

    Represents a collection of attributes.

    Syntax :

    Code:
    Visual Basic (Declaration) :
    
    <ComVisibleAttribute(True)> _
    <HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization := True)> _
    Public Class AttributeCollection _
        Implements ICollection, IEnumerable
    Code:
    Visual Basic (Usage) :
    
    Dim instance As AttributeCollection
    Code:
    C# :
    
    [ComVisibleAttribute(true)]
    [HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true)]
    public class AttributeCollection : ICollection, 
        IEnumerable
    Code:
    Visual C++ :
    
    [ComVisibleAttribute(true)]
    [HostProtectionAttribute(SecurityAction::LinkDemand, Synchronization = true)]
    public ref class AttributeCollection : ICollection, 
        IEnumerable
    Code:
    JScript :
    
    public class AttributeCollection implements ICollection, IEnumerable

Similar Threads

  1. Retrieve attribute as string
    By ISAIAH in forum Software Development
    Replies: 5
    Last Post: 27-02-2010, 01:51 AM
  2. How to set file attribute?
    By Julli_gaada in forum Tips & Tweaks
    Replies: 3
    Last Post: 21-11-2009, 08:05 PM
  3. Custom AD attribute - [WP]
    By OmJaa in forum Active Directory
    Replies: 3
    Last Post: 11-03-2008, 07:17 PM
  4. Change Read-Only Attribute
    By William Colls in forum Vista Help
    Replies: 2
    Last Post: 18-02-2008, 05:53 AM
  5. Cannot Remove Read-Only Attribute
    By vshori in forum Small Business Server
    Replies: 2
    Last Post: 12-05-2007, 03:23 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,190,123.84539 seconds with 16 queries