为什么参数化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)
)
)
%>
我做错了吗?