分析器错误
说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。
分析器错误消息: ID“HdnSelectedValues2”已被其他控件使用。
源错误:
行 65: </table>
行 66: </div>
行 67: <input type="hidden" id="HdnSelectedValues2" runat="server" />
行 68:
行 69:
|
源文件: /Default.aspx 行: 67
版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.34249
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>文书档案</title> <script type="text/javascript" src="js/chkcontrol.js"></script> <script type="text/javascript"> function AddRemoveValues(oChk, theForm) { if (oChk.checked) { theForm.HdnSelectedValues2.value += ",'" + oChk.value + "'"; } else { theForm.HdnSelectedValues2.value = theForm.HdnSelectedValues2.value.replace(",'" + oChk.value + "'", ""); //HdnSelectedValues2为页面上隐藏选择内容的信息 <asp:HiddenField ID="HdnSelectedValues2" runat="server" /> } } ///全选 function CheckAll(checkbox, theForm) { var elements = theForm.elements; for (var i = 0; i < elements.length; i++) { if (elements[i].type == "checkbox" && elements[i].id != checkbox.id) { elements[i].checked = checkbox.checked; AddRemoveValues(elements[i], theForm); } } } </script> </head> <body runat="server"> <form id="ArViewFrm" runat="server"> <div align="center"> <table width="780" cellpadding="0" cellspacing="0" align="center"> <tr> <td> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="AliceBlue" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" GridLines="Vertical" Width="100%" HorizontalAlign="Left" ForeColor="Black" OnDataBound="GridView1_DataBound"> <FooterStyle BackColor="#CCCCCC" /> <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" /> <HeaderStyle BackColor="LightSteelBlue" Font-Bold="True" ForeColor="White" /> <AlternatingRowStyle BackColor="White" /> <Columns> <asp:TemplateField> <HeaderTemplate> <input type="checkbox" id="All" name="All" onclick="CheckAll(this, document.ArViewFrm)" runat="server"/>全选 </HeaderTemplate> <ItemTemplate> <input type="checkbox" id="chkSelect" onclick="javascript: AddRemoveValues(this, document.ArViewFrm);" name="chkSelect" runat="server" value='<%# Eval("RecID")%> '/> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </td> </tr> <tr> <td> </td> </tr> </table> </div> <input type="hidden" id="HdnSelectedValues2" runat="server" /> </form> </body> </html>