I have a razor page that uses T4template. Here is my razor code:
@model ResearchViewModel
<form method="POST" action=">
...
@if (!Model.IsFinalized)
{
using (Html.BeginForm(MVC.Research.ActionNames.Reject, MVC.Research.Name, null, FormMethod.Post, new { @id = "RejectForm" }))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(model => model.Id)
}
using (Html.BeginForm(MVC.Research.ActionNames.Accept, MVC.Research.Name, null, FormMethod.Post, new { @id = "AcceptForm" }))
{
@Html.AntiForgeryToken()
@Html.HiddenFor(model => model.Id)
}
}
...
</form>
The problem is that when the razor rendering this page, it cannot rendering first form !! I tried to change the sequence of these forms, and found that always the first form is not rendered. I Also tried to separate these forms using the partialview but the problem still exist. Does anyone knows that what's happening ?