为什么参数化 Action 和 Partial 视图名称会引发 ArgumentException 错误?
<div id = "Details" >
<% var ActionName = ViewContext.RouteData.GetRequiredString("action"); %>
<% var PartialViewName = ViewContext.RouteData.GetRequiredString("action"); %>
<% using (Html.BeginForm(ActionName, "ControllerName")) %>
<% { %>
<% Html.RenderPartial(PartialViewName, new List<Model>()); %>
<% } %>
</div>
将其更改为以下作品:
<div id = "Details" >
<% using (Html.BeginForm("ActionName", "ControllerName")) %>
<% { %>
<% Html.RenderPartial("PartialViewName", new List<Model>()); %>
<% } %>
</div>
仅当我参数化 Action 和 Partial 视图名称时,我才会收到以下错误:
Group with specified name "jQuery" already exists. Please specify a different name.
Exception Details: System.ArgumentException: Group with specified name "jQuery" already exists. Please specify a different name.
第 27 行:
Line 25: .Compress(true)
Line 26: ).StyleSheets(styles =>
Line 27: styles.AddGroup("jQuery", group =>
Line 28: group.DefaultPath("~/Scripts/css")
Line 29: .Add("start/jquery-ui-1.8.1.custom.css")
从其中调用部分视图的视图将 Site.Master 作为其主视图。脚本、css 注册在 Site.Master Site.Master 中:
<%=
Html.Telerik().StyleSheetRegistrar().DefaultGroup(group =>
group.DefaultPath("~/Content")
.Add("Site.css")
.Add("telerik.common.css")
.Compress(true)
).StyleSheets(styles =>
styles.AddGroup("jQuery", group =>
group.DefaultPath("~/Scripts/css")
.Add("start/jquery-ui-1.8.1.custom.css")
.Add("jquery.pnotify.default.css")
.Compress(true)
)
)
%>
难道我做错了什么?