How to use an actionresult to return both a view and a partial view
How can I use use an actionResult to return both a view and a partial view. Actually in case of an ajax request it should send a partial view else it should send a view.
public ActionResult Test(string Name ="", DateTime? Date= null, string sex="" )
{
myModel model = new myModel(Name, Date, Sex);
if(IsAjaxRequest)
return PartialView("partialView", model)
else
开发者_开发技巧return View(model);
}
if (Request.IsAjaxRequest())
return PartialView("_Article", model);
return View(model);
精彩评论