J'utilise VS 2008, j'ai une page très simple qui a un tas de contrôles nommés unique. Lorsque je tente de voir en mode de conception, je reçois l'erreur suivante:Erreur de temps de conception - plusieurs contrôles avec le même Id
Error Rendering Control - Label12
An unhanded exception has occurred.
Multiple controls with the same ID 'Label1' were found. FindControl requires that controls have unique IDs
J'ai vérifié le code HTML et le fichier de concepteur et je ne peux voir un contrôle appelé Label1. Qu'est-ce qui pourrait en être la cause?
Aussi, voici le balisage ASPX je vais avoir des problèmes avec?
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CoachingAppearanceReport.aspx.vb"
Inherits="AcademyPro.CoachingAppearanceReport" %>
<!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">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="appearanceDetail" class="Left CriteriaContainer">
<asp:Label ID="Label1" runat="server" Text="Appearance Type" AssociatedControlID="ddlAppearanceType" />
<asp:DropDownList ID="ddlAppearanceType" runat="server" CssClass="AppType" OnDataBound="ddlAppearanceType_DataBound"
DataSourceID="odsAppearanceType" DataTextField="AppearanceType" DataValueField="AppearanceTypeCode">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="rfvAppearanceType" runat="server"
ControlToValidate="ddlAppearanceType" InitialValue="" Text="*"
ErrorMessage="The appearance type must be selected" />
<asp:Label ID="lblAppearanceType" runat="server" />
<br />
<div class="SubSettings">
<asp:Label ID="Label12" runat="server" Text="Subbed for" AssociatedControlID="ddlSubbedFor" />
<asp:DropDownList ID="ddlSubbedFor" runat="server" OnDataBound="ddlSubbedFor_DataBound"
DataSourceID="odsPlayersInAgeGroup" DataTextField="PlayerName" DataValueField="PlayerID">
</asp:DropDownList>
<asp:Label ID="lblSubbedFor" runat="server" />
<br />
<asp:Label ID="Label13" runat="server" Text="Mins" AssociatedControlID="txtSubMins" />
<asp:TextBox ID="txtSubMins" runat="server" MaxLength="3" CssClass="TinyWidth" />
<asp:Label ID="lblSubMins" runat="server" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
Oui, c'est une application web. J'ai déjà vérifié le fichier du concepteur et trouvé un seul contrôle Label1. Je vais essayer de supprimer le fichier de concepteur entier et la régénération pour voir si cela résout le problème. – ilivewithian