Class Script
Generate a standard HTML5 <script> tag
Inheritance
Implements
Inherited Members
Namespace: ToSic.Razor.Html5
Assembly: ToSic.Razor.dll
Syntax
public class Script : Tag<Script>, IHtmlContent, ITag, IEnumerable<ITag>, IEnumerable
Methods
| Improve this Doc View SourceAsync()
Activate the async attribute on the <script> tag
Declaration
public Script Async()
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |
Async(String)
Set the async attribute on the <script> tag
Declaration
public Script Async(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in async='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |
Charset(String)
Set the charset attribute on the <script> tag
Declaration
public Script Charset(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in charset='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |
Defer()
Activate the defer attribute on the <script> tag
Declaration
public Script Defer()
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |
Defer(String)
Set the defer attribute on the <script> tag
Declaration
public Script Defer(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in defer='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |
Src(String)
Set the src attribute on the <script> tag Automatically url-encode it if contains spaces, umlauts or other unexpected chars
Declaration
public Script Src(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in src='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |
Type(String)
Set the type attribute on the <script> tag
Declaration
public Script Type(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in type='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Script | a Script object to enable fluid command chaining |