Class AttributeBase
Implements
System.Web.IHtmlString
Namespace: ToSic.Razor.Markup
Assembly: ToSic.Razor.dll
Syntax
public class AttributeBase : ToHtmlHybridBase, IHtmlString
Constructors
| Improve this Doc View SourceAttributeBase(String, Object, AttributeOptions)
Create an attribute, which can then generated into a name='value' output
Declaration
public AttributeBase(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 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 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
System.Object.ToString()
Implements
System.Web.IHtmlString