top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to find if the request is from Ajax in ASP.NET MVC?

0 votes
308 views
How to find if the request is from Ajax in ASP.NET MVC?
posted May 30, 2016 by Jayshree

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

namespace AbundantCodeMVC.Controllers

{

public class HomeController : Controller

{

//

// GET: /Home/

public ActionResult Index()

{

if (Request.IsAjaxRequest())

return PartialView();

return View();

}

}

}
answer May 30, 2016 by Shivaranjini
...