开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜