Tuesday, January 28, 2020

Asynchronously load a partial view in the Razor stuff for a .NET Core application.

@await Html.PartialAsync("_DelayedLoad", new ViewDataDictionary(this.ViewData) {
   { "div", "maintvolume" },
   { "url", Html.Raw(@Url.Action("VolumesReport", "Distributors", new
         {Model.VolumeType, Model.DistributorId, month=Model.VolumeMonth,
         year=Model.VolumeYear, levelId=Model.LevelId, Model.IsBoundToCycles})) }
})

 
 

By the way ViewDataDictionary is the magic for handing more than one model into a Controller.

No comments:

Post a Comment