Reputation: 7105
I have an page where I create a form like
@{
ViewBag.Title = "Login";
}
@Styles.Render("~/bundles/login/css")
@Html.BeginForm("Index", "Login", null)
{
// Normal HTML content that constructs the form.
}
The form works as expected and is redirecting to the specified controller when submitted, but the following unwanted text is displayed at the top of the page,
System.Web.Mvc.Html.MvcForm {}
I can't figure out why this text would be displayed. Any ideas?
Upvotes: 1
Views: 126
Reputation: 1477
You should use
@using(Html.BeginForm("Index", "Login", null))
{
//Code here
}
or Else use
Html.EndForm
for complimenting the Html.Beginform
Upvotes: 2
Reputation: 400
@{
ViewBag.Title = "Login";
}
@Styles.Render("~/bundles/login/css")
@using(Html.BeginForm("Index", "Login", null))
{
// Normal HTML content that constructs the form.
}
Upvotes: 2