我在索引文件中使用了此页面控件。有三个选项卡,每个选项卡都会看到一些视图。它适用于第一个标签加载,但是,当我切换到第二个和第三个标签时,没有任何显示。我错过了什么吗?
@Html.DevExpress().PageControl(
settings =>
{
settings.Name = "pcClientSideAPI";
settings.EnableClientSideAPI = true;
settings.ActivateTabPageAction = ActivateTabPageAction.Click;
settings.EnableHotTrack = true;
settings.Styles.Content.Paddings.Padding = 20;
settings.Width = Unit.Percentage(100);
settings.Height = 200;
settings.TabPages.Add("Page1", "page1").SetContent(() =>
{
Html.RenderPartial("PortfolioChartPartial", Model);
Html.RenderPartial("OriginationYearChartPartial", Model);
Html.RenderPartial("MaturityYearChartPartial", Model);
Html.RenderPartial("PropertyTypeChartPartial", Model);
Html.RenderPartial("StateChartPartial", Model);
Html.RenderPartial("RegionChartPartial", Model);
Html.RenderPartial("WALChartPartial", Model);
Html.Action("SummaryDataPartial", Model);
});
settings.TabPages.Add("Page2", "page2").SetContent(() =>
{
@Html.RenderPartial("AnalysisDataPartial", Model);
});
settings.TabPages.Add("AllData", "page3").SetContent(() =>
{
@Html.RenderPartial("AllDataPartial", Model);
});
}).GetHtml()
答案 0 :(得分:1)
只需使用Html.RenderPartial(“......”); 不需要@符号。您添加了@ Html.RenderPartial()而不是Html.RenderPartial。这就是为什么第二个和第三个标签没有显示的原因。试着提供反馈