I upgraded to 7.5.3, which broke the backend, so I downgraded to 7.4.3 which I have another site using the controller working perfectly on.
However, I am still getting the error. The Umbraco version reports as 7.4.3. All assemblies in the two sites have been binary compared and are identical.
I don't really know where to go from here. I need to get the login working for a client demo, and it's taken me all morning, whereas before it has literally been plug and go.
Cut down sample of controller is:
[ChildActionOnly]
[HttpPost]
public ActionResult Login(LoginViewModel model)
{
ActionResult res = null;
MembershipControllerLoginEventArgs eargs = new MembershipControllerLoginEventArgs(false, model.UserName);
OnLoggingIn(eargs);
if (Membership.ValidateUser(model.UserName, model.Password))
{
...
res = PartialView("UserInfo", GetUserInfo(user));
}
return res;
}
Is it because your Login Child Action is decorated with HttpPost ?
When you are using Html.Action to write out a Child Action, then my hunch is it's not making a Post request.
You probably want to have a Child Action, that writes out the Login Form without a HttpPost, and then a seperate Action that IS decorated with HttpPost that handles the posting of that form, with it's LoginViewModel, runs your user validation logic.
but I'm not sure why an identical implementation appears to work elsewhere ?
Hmmm, what you're saying does make sense, except that this does work perfectly on probably 10+ other sites of varying older and newer versions of Umbraco!
Route hijacking problems
Going complete insane with the
Cannot bind source type Blah to model type Umbraco.Web.Models.RenderModel
message.I have a simple MVC membership system to provide member logins using the .NET providers. I've used it across loads of Umbraco sites with no problems.
After trying on one site and getting the above error, I found this thread: https://our.umbraco.org/forum/using-umbraco-and-getting-started/75998-update-to-742-all-custom-hijacked-controllers-stopped-working which suggests it's a specific error with 7.4.2.
I upgraded to 7.5.3, which broke the backend, so I downgraded to 7.4.3 which I have another site using the controller working perfectly on.
However, I am still getting the error. The Umbraco version reports as 7.4.3. All assemblies in the two sites have been binary compared and are identical.
I don't really know where to go from here. I need to get the login working for a client demo, and it's taken me all morning, whereas before it has literally been plug and go.
Cut down sample of controller is:
The views on both sites are identical and are:
I do not understand whow I can be getting this error on a site with identical binary versions to a working site. Please help!
Hi Rob
Is it because your Login Child Action is decorated with HttpPost ?
When you are using Html.Action to write out a Child Action, then my hunch is it's not making a Post request.
You probably want to have a Child Action, that writes out the Login Form without a HttpPost, and then a seperate Action that IS decorated with HttpPost that handles the posting of that form, with it's LoginViewModel, runs your user validation logic.
but I'm not sure why an identical implementation appears to work elsewhere ?
regards
Marc
Hmmm, what you're saying does make sense, except that this does work perfectly on probably 10+ other sites of varying older and newer versions of Umbraco!
Since you are saying it is working for other environments ...
Did you compare the web.config files?
Especially the settings for:
Umbraco related to membership, authentication, ModelsBuilder, ... and
member & role provider related stuff
Another thing to check is if there are any special routings in place for this situation that might conflict/override/bypass your code?
Hope this drives you back to sanity ;-)
is working on a reply...