我不确定为什么这个语法会出现错误“输入未声明,可能因防护级别而无法访问”,必须将“@html(”错误。在Razor中使用VB.net MVC不能正常工作
此块抱怨错误
@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" />
喜nemesv如果使用@<Text>
,它的抱怨这一点 - “使用必须结束而终止使用”>
你已经忘记关闭@'在我的例子中看到我有:'@ '注意关闭' '该线。 –
nemesv
2013-05-08 07:28:59
反对!在MVC中太新了。一切似乎都对我来说很新鲜,谢谢! – tsohtan 2013-05-08 07:30:27
[为什么@Using Html.BeginForm中的普通标记需要@?](http://stackoverflow.com/questions/10225394/why-does-normal-markup-inside-an-using-html- beginform-need-an) – KyleMit 2014-11-10 21:58:23