2013-09-25 75 views
1

上顯示不需要的文本我有,我創建像剃刀形式

@{ 
    ViewBag.Title = "Login"; 
} 

@Styles.Render("~/bundles/login/css") 

@Html.BeginForm("Index", "Login", null) 
{ 
    // Normal HTML content that constructs the form. 
} 

形式按預期工作,並提交時重定向到指定的控制器,但下面不需要的文本在顯示形式的頁面在頁面的頂部,

System.Web.Mvc.Html.MvcForm {} 

我想不通爲什麼這個文本將被顯示。有任何想法嗎?

+1

可能的複製http://stackoverflow.com/questions/4975354/html-beginform-顯示系統的Web-MVC-HTML-mvcform上頁 – Farax

回答

2
@{ 
ViewBag.Title = "Login"; 
} 

@Styles.Render("~/bundles/login/css") 

@using(Html.BeginForm("Index", "Login", null)) 
{ 
// Normal HTML content that constructs the form. 
} 
2

您應該使用

@using(Html.BeginForm("Index", "Login", null)) 
{ 
//Code here 
} 

或者使用

Html.EndForm的恭維Html.Beginform