Search code examples
asp.net-mvc-3html.beginform

MVC3 BeginForm not rendering <form> tags


I have an issue with my view not rendering the opening and closing FORM tags. Below is the code to my controller

    [HttpGet, Authorize]
    public ActionResult Edit(long id)
    {
        Position position = positionRepository.GetPositionById(id);
        return View(position);
    }

And this is the code on my view (omitting the controls code)

@using (Html.BeginForm("Edit", "Position", new { area = "Stock", id = Model.PositionId }, FormMethod.Post, null)){}

When the page is called it renders the appropriate data but the HTML side does not include the opening and closing FORM tags which will be required in order to save the modifications. Any clue as to what I may be missing?

enter image description here enter image description here


Solution

  • I found the root cause to be my master page. When adding the master page I selected a standard master page NOT one from the MVC3 list!. I proceeded to delete the existing master page and added the proper one (from the MVC3 list) refreshed the page and the tags were rendered properly.