首页 > 代码库 > ASP.NET MVC PartialView用法

ASP.NET MVC PartialView用法

子页面AreaSelect.cshtml页面的Controller代码:

public ActionResult AreaSelect(){    return PartialView();}

父页面前台代码:

<td>    @{         ViewDataDictionary data = http://www.mamicode.com/new ViewDataDictionary();"areaId", "2");        Html.RenderPartial(Url.Content("~/Views/Backstage/Area/AreaSelect.cshtml"), null, data);    }</td>

子页面前台获取父页面传入的参数:

@{     string areaId = ViewBag.areaId;}

 

ASP.NET MVC PartialView用法