PDA

View Full Version : [CLOSED] Razor Syntax for Button LoadingState



leonardm
Mar 31, 2014, 2:23 AM
Hi,

Can you please give me the syntax for the MVC (Razor) version of this:


2. Button with custom <LoadingState> configuration

<ext:Button runat="server" Text="Click Me" OnDirectClick="Button1_Click">
<LoadingState Text="Please Wait..." />
</ext:Button>

Thanks!
Leo

Daniil
Mar 31, 2014, 4:48 PM
Hi @leonardm,

Example

@Html.X().Button().LoadingState(ls => ls.Text = "Please Wait...")

leonardm
Mar 31, 2014, 5:36 PM
Hi @leonardm,

Example

@Html.X().Button().LoadingState(ls => ls.Text = "Please Wait...")

This is failing for me


X.Button().Text("Save").Icon(Icon.Disk).LoadingState(ls => ls.Text = "Saving...")

with message: Object reference not set to an instance of an object.

Do I need to "New up" anything first?

Thanks,
Leo

Daniil
Apr 01, 2014, 3:28 AM
Sorry. Please update from the SVN trunk (revision #5743) and use:

@Html.X().Button().LoadingState(new ButtonLoadingState() { Text = "Saving..." })
or

@Html.X().Button().LoadingState(X.ButtonLoadingSta te().Text("Saving..."))