我不確定爲什麼這個語法會出現錯誤「輸入未聲明,可能因防護級別而無法訪問」,必須將「@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