I am trying to log-in with the Ajax-supported log-in.
I created my controller in some logic to sign the user and then returns the normal partial welcome message and logoff action ActionLink My verb method looks like this:
Public Action Logon (Logon Model Model, String Return URL) {If (ModelState.IsValid) {If Subscription Service Validation User (Model User Name, Model Password)) {FormsService.SignIn (model.UserName , Model.RememberMe); (Request.IsAjaxRequest ()) // // Here's the problem: (see "login inform", model);} and (if !! string.isnalaut (return URL)) redirect return (return url) ; And redirection return (return) "index", "home");}} other {ModelState.AddModelError ("", "the supplied username or password is incorrect."); If (request .asAxAxEndest) {return content ("was an error!);}}} Return view (model);}
And I was trying to return this simple partial
Welcome & lt; b & gt; & lt;% = Html.Encode (Model.UserName)%> & lt; / b & gt;! & Lt;% = Html.exeLink ("Log Off", "Logoff", "Account")%>
and two-partly typed for LogOnModel. < / P>
But if I see ("partial name")
always with status code 500 onfile . When I returned the
content ("my message")
everything is getting correct.
So please tell me that I Why always get "this status code = 500" ?? Where's the big mistake ??.
Try the following:
If requested (request.saAx request) () Return a partial view ("Login inform", Model);}
Ensure Make sure you have a strongly typed l OggededInForm.ascx
is in the same view folder as the controller name.
The error can not be used to see the exact error message acted on this AJAX request.
Comments
Post a Comment