Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , ,

Sponsored Links


How to set HTML Tag Attribute in asp.net

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 08-06-2009
Member
 
Join Date: Mar 2009
Posts: 55
How to set HTML Tag Attribute in asp.net

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

Reply With Quote
  #2  
Old 08-06-2009
Modifier's Avatar
Member
 
Join Date: Jan 2008
Posts: 1,507
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.
Reply With Quote
  #3  
Old 08-06-2009
Praetor's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,943
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.

Quote:
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
Reply With Quote
  #4  
Old 08-06-2009
Member
 
Join Date: May 2008
Posts: 2,000
Re: How to set HTML Tag Attribute in asp.net

AttributeCollection Class :

Represents a collection of attributes.

Quote:
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to set HTML Tag Attribute in asp.net"
Thread Thread Starter Forum Replies Last Post
Retrieve attribute as string ISAIAH Software Development 5 27-02-2010 12:51 AM
How to set file attribute? Julli_gaada Tips & Tweaks 3 21-11-2009 07:05 PM
Custom AD attribute - [WP] OmJaa Active Directory 3 11-03-2008 07:17 PM
Change Read-Only Attribute William Colls Vista Help 2 18-02-2008 04:53 AM
Cannot Remove Read-Only Attribute vshori Small Business Server 2 12-05-2007 03:23 AM


All times are GMT +5.5. The time now is 05:53 AM.