LinkButton
in namespace DotVVM.Framework.Controls.Bootstrap
Extends the builtin LinkButton control to allow applying Bootstrap CSS classes to the link.
Usage & Scenarios
Extends the builtin LinkButton control to allow using Bootstrap button CSS classes.
Sample 1: LinkButton Sizing
Use the Size
property to set the size of the button.
<bs:LinkButton Click="{command: DoSomething()}"
Text="Button" />
<bs:LinkButton Click="{command: DoSomething()}"
Text="Button"
Size="Large" />
<bs:LinkButton Click="{command: DoSomething()}"
Text="Button"
Size="Small" />
<bs:LinkButton Click="{command: DoSomething()}"
Text="Button"
Size="ExtraSmall" />
using DotVVM.Framework.ViewModel;
namespace DotvvmWeb.Views.Docs.Controls.bootstrap.Button.sample1
{
public class ViewModel : DotvvmViewModelBase
{
public void DoSomething()
{
}
}
}
Sample 2: LinkButton Types
The Type
property specifies the color of the button (using standard Bootstrap classes).
<bs:LinkButton Click="{command: DoSomething()}"
Text="Default"
Type="Default" />
<bs:LinkButton Click="{command: DoSomething()}"
Text="Primary"
Type="Primary" />
<bs:LinkButton Click="{command: DoSomething()}"
Text="Success"
Type="Success" />
<bs:LinkButton Click="{command: DoSomething()}"
Text="Info"
Type="Info" />
<bs:LinkButton Click="{command: DoSomething()}"
Text="Warning"
Type="Warning" />
<bs:LinkButton Click="{command: DoSomething()}"
Text="Danger"
Type="Danger" />
using DotVVM.Framework.ViewModel;
namespace DotvvmWeb.Views.Docs.Controls.bootstrap.Button.sample2
{
public class ViewModel : DotvvmViewModelBase
{
public void DoSomething()
{
}
}
}
Properties
Name | Type | Description | Notes | Default Value | |
---|---|---|---|---|---|
ClientIDMode | ClientIDMode | Gets or sets the client ID generation algorithm. |
attribute
static value
|
Static | |
DataContext | Object | Gets or sets a data context for the control and its children. All value and command bindings are evaluated in context of this value. The DataContext is null in client-side templates. |
attribute
bindable
|
null | |
Enabled | Boolean | Gets or sets a value indicating whether the button is enabled and can be clicked on. |
attribute
static value
bindable
|
True | |
ID | String | Gets or sets the control client ID within its naming container. |
attribute
static value
bindable
|
null | |
IncludeInPage | Boolean | Gets or sets whether the control is included in the DOM of the page. |
attribute
bindable
|
True | |
InnerText | String | Gets or sets the inner text of the HTML element. Note that this property can only be used on HtmlGenericControl directly and when the control does not have any children. |
attribute
static value
bindable
|
null | |
Size | Size | Gets or sets the size of the button. |
attribute
static value
bindable
|
Default | |
Text | String | Gets or sets the text on the button. |
attribute
static value
bindable
|
||
Type | BootstrapColor | Gets or sets the color of the button. |
attribute
static value
bindable
|
Default | |
Visible | Boolean | Gets or sets whether the control is visible. When set to false, `style="display: none"` will be added to this control. |
attribute
bindable
|
True |
Events
Name | Type | Description | |
---|---|---|---|
Click | Command | Gets or sets the command that will be triggered when the button is clicked. |