expeted\"" />
开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜