Contour submit calls Html.Action from other controller
Hi!
Our webpage has a Login-form in our header and a form in our body. When submitting the form from our body, the form in the header is also sent. Showing some code might clear it up:
At LoginSurfaceController we have:
[HttpGet]
public PartialViewResult Login()
{
var vm = MemberBuilder.BuildMemberLoginVM();
return PartialView("_Login", vm);
}
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<JsonResult> Login(MemberLoginVM model)
{
var response = LoginBuilder.Login(model);
return Json(response);
}
In the gridContent I have added a form. It renders correctly, and so does the Login-form.
When I log in with the Login-form, everything works fine. But if I'm not logged in and I'm submitting the contour-form, I come to a completly empty white page, after I've got an exception from the Login(MemberLoginVM model)-function. Instead of, as when I'm rendering the page the first time, the LoginSurface does not call for the GET-function, but instead call the POST-function with null as model.
Do you know why this is happening? Are we doing something wrong, or do we have to modify the contour-view in some way?
Contour submit calls Html.Action from other controller
Hi!
Our webpage has a Login-form in our header and a form in our body. When submitting the form from our body, the form in the header is also sent. Showing some code might clear it up:
At LoginSurfaceController we have:
And in the TestForms.cshtml it looks like this:
In the gridContent I have added a form. It renders correctly, and so does the Login-form.
When I log in with the Login-form, everything works fine. But if I'm not logged in and I'm submitting the contour-form, I come to a completly empty white page, after I've got an exception from the Login(MemberLoginVM model)-function. Instead of, as when I'm rendering the page the first time, the LoginSurface does not call for the GET-function, but instead call the POST-function with null as model.
Do you know why this is happening? Are we doing something wrong, or do we have to modify the contour-view in some way?
is working on a reply...