I m beginner asp.net mvc developer.And I don't understand, Why has used both Json and ActionResult in Account controller(for register, login and etc.) in default asp.net MVC 4 project?
Thanks.
I m beginner asp.net mvc developer.And I don't understand, Why has used both Json and ActionResult in Account controller(for register, login and etc.) in default asp.net MVC 4 project?
Thanks.
It's because in the ASP.NET MVC 4 the Login and Register forms are shown in a jQuery dialog and both forms POST to the Account controller using AJAX. The other actions that return views are similar to what existed in previous versions. For example if the user has javascript disabled he won't be able to use jQuery dialog and AJAX and he will fallback to standard HTML.
Do you means having both JsonResult and ActionResult for (register and login view) in default MVC 4 template?
It means two views for both Register & Login form. One is using with ajax and the other is as normal view.
eg: Click on "Register" link on top, it will popup ajax "Register" view.
Click on "Login" link on top -> click "Register", it will show as normal view.
Alariza,
As Darin pointed out, there are two action methods for each form (Register & Login). One action method is used for the popup version of the view and the other is for the normal view.
Don't get discouraged by the negative comments.