I Finally got with this,
public ActionResult Index([DataSourceRequest]DataSourceRequest request, string LocationId)
{
if (Request.Params["LocationId"] != null)
{
using (var client = new HttpClient())
{
AssetRepository assetrep = new AssetRepository();
Guid LocationID = new Guid();
LocationID = new Guid(Request.Params["LocationId"].ToString());
var msgs = assetrep.GetAssetsForLocation(LocationID).ToDataSourceResult(request);
return Json(msgs);
}
}
else
{
return View();
}
}