Class Attribute
Inheritance
System.Object
ToSic.Razor.Markup.RawHtmlString
Attribute
Implements
System.Web.IHtmlString
Namespace: ToSic.Razor.Markup
Assembly: ToSic.Razor.dll
Syntax
public class Attribute : RawHtmlString, IRawHtmlString, IHtmlString
Constructors
| Improve this Doc View SourceAttribute(String, Object, AttributeOptions)
Create an attribute, which can then generated into a name='value' output
Declaration
public Attribute(string name, object value = null, AttributeOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The attribute name, can also be a prepared attribute. So you can pass in "id" or "id='27'" |
System.Object | value | The value, if the initial name was really only a name. If it's an object, it will be json serialized |
AttributeOptions | options | Options how the attribute will be generated |
Fields
| Improve this Doc View SourceName
Attribute name is null, if a prepared attribute was added
Declaration
public readonly string Name
Field Value
Type | Description |
---|---|
System.String |
Options
Declaration
public AttributeOptions Options
Field Value
Type | Description |
---|---|
AttributeOptions |
Value
Attribute value can be null if a prepared attribute was added, or no value specified
Declaration
public readonly object Value
Field Value
Type | Description |
---|---|
System.Object |
Methods
| Improve this Doc View SourceToString()
Gets the HTML encoded string
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
ToSic.Razor.Markup.RawHtmlString.ToString()
Implements
System.Web.IHtmlString