1
Hello.
I have a user control newsletter and it is added in various places within the project, for each page on which it is called, a property is set to insert the email into a particular group of emails (GrupoEmailNewsletter
). It turns out that now beyond the internal pages the same UC will be on MasterPage
, where he started giving problems.
In the master is registered and called:
<%@ Register Src="../UserControl/BoxNewsletter.ascx" TagName="BoxNewsletter" TagPrefix="uc3" %>
<uc3:BoxNewsletter ID="boxNewsletter" runat="server" GrupoEmailNewsletter="Geral" />
And on the page GrupoA.aspx
is also registered and called:
<%@ Register TagPrefix="uc5" Src="~/Include/UserControl/BoxNewsletter.ascx" TagName="Newsletter" %>
<uc5:Newsletter id="ucNewsletter" runat="server" GrupoEmailNewsletter="GrupoA" />
When to access the page GrupoA.aspx
, the following error occurs:
ERRO DO SISTEMA:
Exceção do tipo 'System.Web.HttpUnhandledException' foi acionada.
Uma exceção foi acionada pelo destino de uma chamada.
Já existe uma entrada com a mesma chave.
I have located the ids and have no equal. What else would this error?
It can be an id of your Usercontrol it will be duplicated if you use it on Masterpage and then use it on another page you inherit from Masterpage.
– Marco Souza
@Thank you, that’s exactly it. In this User Control Newsletter has validations, in this
Master
were not added to theRequeredFieldValidator
. I added the propertyClientIDMode="AutoID"
in all theRequeredFieldValidator
of UC and worked properly.– Luciane
Okay, you can post how you did it as an answer, so others who have the same problem will know how to solve it.
– Marco Souza