我正在尝试修改这段代码:来获取ViewBag数据,以便在PDF中呈现视图。基本上,我需要向Html.RenderPartial传递一个新的上下文我的ViewBag,现在的代码是:我试着把它改成这样:Html.RenderPartial(viewName, model, new ViewDataDictionary(ViewBag));
我没有
我正在开发一个mvc-app,当一个操作无效时,我想要在屏幕上呈现“错误消息”。if(result < 0) ViewData["ErrorMessage"] = "There are not enough left of this item to";
}@{
ViewBag.Title = "Object Man