【发布时间】:2013-05-01 02:59:50
【问题描述】:
我不知道为什么这个语法会报错“Enter is not declared。可能由于保护级别而无法访问”,必须输入“@html(”才能消除错误。
这个区块报错
@Using (Html.BeginForm("GetUser", "UserProfile", FormMethod.Post))
Enter User id :- @Html.TextBox("UserId",Model) -- This line must write in this way @Html("Enter User id :-")
<input type="submit" value="Submit data" /> --This line complain ">" expected"
End Using
如果这样改写代码,报错就没有了,但输出的开头显示“System.Web.MVC.Html”,如下图所示
@Html.BeginForm("GetUser", "UserProfile", FormMethod.Post)
Enter User id :- @Html.TextBox("UserId",Model)
<input type="submit" value="Submit data" />
你好,如果使用@<Text>
,这是抱怨——>“使用必须以结束使用结束。”
【问题讨论】:
-
您忘记了
@<text>的结束,在我的示例中,我有:@<text><input type="submit" value="Submit data" /></text>请注意行尾的结束</text>。 -
哎呀!在 MVC 中太新了。一切对我来说都是新的,谢谢!。
标签: asp.net-mvc vb.net razor