Reputation: 22810
I'm having trouble translating the following c#/Razor template into VB
@Html.TextBox("", String.Format("{0:d}", Model.Date.ToShortDateString()),
new { @class = "datefield" })
Specifically, how do I translate the @class
@Html.TextBox("", String.Format("{0:d}", Model.Date.ToShortDateString(), New With { @class = "datefield" })
gives the error BC30201: Expression expected.
Upvotes: 0
Views: 803
Reputation: 24236
Try this -
Html.TextBox("", [String].Format("{0:d}", Model.[Date].ToShortDateString()), New With {.[class] = "datefield"})
Upvotes: 3
Reputation: 3269
Get rid of the brackets, they are not necessary:
@Html.TextBox("", String.Format("{0:d}", Model.Date.ToShortDateString()), New With {.class = "datefield"})
The Telerik converter works well, but converting Razor syntax leaves a lot to be desired. :)
Upvotes: 0