Reputation: 353
Based on this question (Link) I want to know if is good to have a mvc application just using ajax call?
Thanks, Pedro
Upvotes: 0
Views: 241
Reputation: 4624
It all depends on your project.
There is no good or bad approach here, but you must remember users that does not have JS enabled. If you depend on ajax for all the app interactions then you must do a separate behaviour for those users that does not use JS (browser JS not enabled).
That always lead to something like this at controller level:
public ActionResult Index()
{
if (Request.IsAjaxRequest())
{
//Ajax Request
//Return partial mostly for partial refresh of the page
return View("PartialView");
}
//Regular Request
return View("FullView");
}
And some SEO issues as mentioned.
Upvotes: 1
Reputation: 8595
It depends on the context. Here are some pros and cons
Pros:
Cons:
Martin
Upvotes: 2