I need to ensure that an application I am developing is accessable and also works with JavaScript turned off. I just need a pointer to assist with the following.
I had 3
You can check the IsMvcAjaxRequest property and use it inside your controller and then return a partial view (user control) or JSON result if true, or the full View if it's false.
Something like this:
public ActionResult List()
{
if (!Request.IsMvcAjaxRequest())
{
// Non AJAX requests see the entire ViewPage.
return View();
}
else
{
// AJAX requests just get a trimmed down UserControl.
return Json(...);
}
}
More info here: MVC AJAX Sites That Gracefully Degrade