System.ArgumentException:具有相同键的条目已存在

2023-12-14

我的母版页,我使用手风琴菜单

<%@ Master Language="C#" AutoEventWireup="true" 
            CodeBehind="DefaultMaster.Master.cs" Inherits="Lab.DefaultMaster" 

ClientIDMode="Static" %>

<%@ Import Namespace="Resources" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<link type="text/css" href="css/style.css" rel="Stylesheet" />
<title>
<asp:ContentPlaceHolder ID="title" runat="server">
</asp:ContentPlaceHolder>
</title>
<link href="css/custom-theme/jquery-ui-1.8.2.custom.css" type="text/css" 
 rel="Stylesheet" />
<link type="text/css" href="css/accordion.css" rel="Stylesheet" />
<script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.2.custom.min.js"></script>
<script src="/js/jquery.cookie.js" type="text/javascript"></script>
<script type="text/javascript" src="/js/ddaccordion.js"></script>
<script type="text/javascript">


ddaccordion.init({ //top level headers initialization
headerclass: "expandable", //Shared CSS class name of headers group that are 
expandable
contentclass: "categoryitems", //Shared CSS class name of contents group
revealtype: "click", //Reveal content when user clicks or onmouseover the header?
Valid value: "click", "clickgo", or "mouseover"
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds 
 before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? 
true/false 
defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. 
 [] denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so  
never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when 
it's collapsed and expanded,

respectively ["class1", "class2"]
togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's 
collapsed and expanded, respectively

["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), 
or keywords "fast", "normal", or "slow"
oninit: function (headers, expandedindices) { //custom code to run when headers
  have initalized
//do nothing
},
onopenclose: function (header, index, state, isuseractivated) { //custom code to 
run whenever a header is opened or closed
//do nothing
}
});
ddaccordion.init({ //2nd level headers initialization
headerclass: "subexpandable", //Shared CSS class name of sub headers group that
are expandable
contentclass: "subcategoryitems", //Shared CSS class name of sub contents group
revealtype: "click", //Reveal content when user clicks or onmouseover the header? 
Valid value: "click" or "mouseover
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before 
 header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? 
 true/false 
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] 
 denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so 
 never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
toggleclass: ["opensubheader", "closedsubheader"], //Two CSS classes to be applied 
 to the header when it's collapsed

and expanded, respectively ["class1", "class2"]
togglehtml: ["none", "", ""], //Additional HTML added to the header when it's 
 collapsed and expanded, respectively

["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200),
 or keywords "fast", "normal", or "slow"
oninit: function (headers, expandedindices) { //custom code to run when headers
  have initalized
//do nothing
},
onopenclose: function (header, index, state, isuseractivated) { //custom code
to run whenever a header is opened or closed
//do nothing
}
});


</script>

<asp:ContentPlaceHolder ID="head" runat="server">

</asp:ContentPlaceHolder>

<style type="text/css">
.style1
{
width: 140px;
}
</style>

</head>

//body

<body style="min-width:930px;">
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td style="vertical-align:top;" class="style1">
<div class="arrowlistmenu">

<h3 class="menuheader expandable">asd</h3>
<ul class="categoryitems">
<li><a href="/GeneralData/Data.aspx">asd</a></li>
</ul>

<h3 class="menuheader expandable">sd</h3>

<ul class="categoryitems">

<li><a href="/Instruct/page2.aspx">sdf</a></li>
<li><a href="/Instruct/page3.aspx">sdf</a></li>
<li><a href="#">sdf</a></li>
<li><a href="#">sdf</a></li>
<li><a href="#">sdf</a></li>
<li><a href="#">sdf</a></li>

</ul>

<h3 class="menuheader expandable">sdf</h3>
<ul class="categoryitems">
<li><a href="#">sdf</a></li> 
<li><a href="#">asd</a></li>
<li><a href="#">asd</a></li>
</ul>
<h3 class="menuheader expandable">asd</h3>
</div>

</td></tr></table>
</body>
</html>

启动页面时,他给了我错误

Server Error in '/' Application.

An entry with the same key already exists.

Description: An unhandled exception occurred during the execution of the current web 
request. Please review the stack trace for more information about the error and where
it originated in the code. 

Exception Details: System.ArgumentException: An entry with the same key already exists.

Source Error: 


An unhandled exception was generated during the execution of the current web request. 

可以识别有关异常的起源和位置的信息 使用下面的异常堆栈跟踪。

Stack Trace: 


[ArgumentException: An entry with the same key already exists.]
   System.Collections.Specialized.ListDictionary.Add(Object key, Object value)
                                                                           +6236205
   System.Web.UI.ClientScriptManager.RegisterExpandoAttribute(String controlId, 
  String attributeName, String attributeValue,
 Boolean encode) +272
   System.Web.UI.ScriptRegistrationManager.RegisterExpandoAttribute(Control control, 
 String controlId, String attributeName, 
String attributeValue, Boolean encode) +115
   System.Web.UI.ScriptManager.RegisterExpandoAttribute(Control control, S
   tring controlId, String attributeName,
 String attributeValue, Boolean encode) +44

您很幸运在代码的第一行中出现了错误原因。因为我只是被它吓坏了。更改您的验证器ClientIDMode to Predictable.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

System.ArgumentException:具有相同键的条目已存在 的相关文章

随机推荐

  • 从存档中解压缩单个文件

    我正在尝试将现有的 Android 应用程序移植到 iOS 在 Android 应用程序中 我使用 ZipInputStream 从 zip 存档中提取单个文件并将其存储为临时文件 我如何从 Zip 存档中提取单个文件 而不必提取整个存档
  • 如何摆脱 python 中的特定警告消息,同时保持所有其他警告正常?

    我正在 python 脚本中隐性地做一些简单的数学运算 并收到以下警告 警告 除法中遇到除以零 为了提供一些背景信息 我采用两个值并尝试找出值的百分比差异 a b a如果它高于某个范围 则对其进行处理 但有时的值a or b为零 我想摆脱这
  • Azure B2C 如何检索内置用户声明/属性

    我尝试使用内置用户属性和声明从 Azure B2C 检索一些非常基本的信息 我只想回来 给定的名称 姓 UserId Email Its not totally obvious to me how B2C is storing this c
  • $scope.$on('$stateChangeStart') 和 $modal 对话框

    我有一个 AngularJs 应用程序 它正在检测状态的更改 使用 ui router 以便向用户提供保存未保存更改的选项 现在我用确认对话框来执行此操作 scope on stateChangeStart gt if self chang
  • 通过单击网页上的按钮来运行/执行 CasperJS 脚本

    我有一个 casperJS 脚本 在命令行上运行时返回 JSON 我想要这样的安排 1 我创建一个网页 2 单击网页上的按钮后 casperJS 脚本将在服务器端执行 并将结果发布 返回到网页 我怎样才能做同样的事情 编辑 我在单击按钮时调
  • 在htaccess中添加GET参数

    我正在寻找一种向 htaccess 添加规则的方法 该规则将自动向子域中传入的请求添加 GET 参数 原因很长 而且似乎无关紧要 因此 sub example com 应该重定向到 sub example com parameter tes
  • 如何在轮播滑块中添加图像之间的间隙或消除滑动时的故障

    我参考这个做了一个轮播link最初发布在此link但不幸的是 我不想在第一张图片中填充 因此 我删除了第一个图像的填充 但这会产生较大的图像宽度 因此 我删除了所有图像中的填充 并为间隙添加了 margin left carousel it
  • 如何使用 JQuery.support 检查浏览器是否为 Firefox?

    似乎 jQuery browser 在最新的 jQuery 中已被弃用 该文档建议我使用 jQuery support 我应该使用哪些支持测试来检查当前浏览器是否为 Firefox 您错过了 支持 方法的要点 您不检查用户是否使用 Fire
  • Python 名称阴影混淆[重复]

    这个问题在这里已经有答案了 所以我有一些与此类似的代码 此代码重现了我的问题 即使它没有做任何有用的事情 def fn l foo bar baz print map lambda f len f l for i f in enumerat
  • Windows Phone 8中如何解析Json数据

    我是 Windows Phone 8 开发新手 我正在开发需要解析 Json 的应用程序 所以我无法在Windows Phone 8中获取以下数据 response errorFlag 0 Score Detail 39 test date
  • 二进制转换函数

    我正在尝试使用我在下面用 C 编写的函数将十进制值转换为二进制值 我不明白为什么它打印 32 个零而不是二进制值 2 include
  • 聊天应用程序可滚动 div 或 Iframe

    使用 iframe 或可滚动 div 使聊天窗口可滚动的建议方法是什么 这两种技术的优缺点是什么 您会选择哪一个 为什么 谢谢 您可以创建一个脚本 将聊天嵌入到第三方网站中 从而创建 div or 主要有趣的差异 iframe Code 所
  • 如何在电子邮件中将 iOS 应用程序的深层链接显示为链接

    我在用着深层链接 for my react native应用程序让用户单击链接来打开我的应用程序并执行一些操作 我的问题是当我发送电子邮件时 使用 a href 标签并将正文作为 HTML 发送给具有这些深层链接的用户 例如myapp pr
  • 使用 awk 提取最大值和最小值

    如何使用下表查找最大值和最小值awk命令 20 90 60 30 55 75 80 85 10 15 99 95 55 95 70 20 9 35 85 75 我想要像 max 这样的输出value 99 and min 9 withgnu
  • sql azure 中的替代 xp_cmdshell

    XP CMDshell 的替代品是什么 它在 sql server 中工作正常 但sql azure不支持 那么 sql azure 的替代品是什么 我假设您需要命令行访问权限来访问 BCP 因为您正在尝试创建数据并将其上传 下载到平面或
  • Spark Streaming update_state_by_keys 用于数组聚合

    我有如下输入行 t1 文件1 1 1 1 t1 文件 1 1 2 3 t1 文件2 2 2 2 2 t2 文件 1 5 5 5 t2 文件2 1 1 2 2 输出如下所示 是相应数字的垂直相加 文件1 1 1 2 5 1 3 5 文件2 2
  • 如何使用 java 获取 Google 的 OAuth 请求令牌

    当我尝试访问 API 时 我很难从 google 获取请求令牌 我收到了标准 400 响应 我发送的请求几乎与他们提供的 OAuth 游乐场中生成的请求相同 我正在使用匿名秘密 密钥并构造了一个基本字符串 如下所示 GET https 3A
  • 如何将带条件的嵌套 foreach 循环转换为 LINQ

    我想问是否可以将下面的嵌套 foreach 循环转换为 LINQ 表达式 public interface IFoo bool IsCorrect IFoo foo void DoSomething IFoo foo List
  • Hibernate 问题 - “使用 @OneToMany 或 @ManyToMany 定位未映射的类”

    我正在适应 Hibernate Annotations 并且遇到了一个问题 希望有人可以帮助解决 我有 2 个实体 Section 和 ScopeTopic 该部分有一个 List 类成员 因此是一对多关系 当我运行单元测试时 我收到此异常
  • System.ArgumentException:具有相同键的条目已存在

    我的母版页 我使用手风琴菜单