HTML inside @Using block in MVC 3 Razor
Visual Studio raises a error when I place HT开发者_高级运维ML inside the @Using block:
"> expeted"
@Using (Ajax.BeginForm("UpdateForm", New AjaxOptions With {.UpdateTargetId = "textEntered"}))
@Html.TextBox("textBox1", "Enter text")
<br />
End Using
I'm using MVC 3, Razor as the view engine, and VS2010 express.
What am I missing?
Thanks
UPDATE: answer here Razor View Engine Quirks in VB.NET
In VBHTML pages, you need to prefix HTML directly inside of code blocks (such as your @Using
block) with @
:
@Using (Ajax.BeginForm("UpdateForm", New AjaxOptions With {.UpdateTargetId = "textEntered"}))
@Html.TextBox("textBox1", "Enter text")
@<br />
End Using
精彩评论