Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4614932
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:46:07+00:00 2026-05-22T01:46:07+00:00

I am trying to subclass the password recovery control in asp.net (4) so that

  • 0

I am trying to subclass the password recovery control in asp.net (4) so that I can override the behaviour of the OnVerifyingUser event but I’m having trouble adding my subclassed password recovery control into the page. I tried creating an asp:placeholder control and adding a new instance of my subclassed control to it but I just get an error that says “An entry with the same key already exists”. I’ve tried doing this in the page_init and page_load methods but get the same error.

Here’s an example of my subclass

Partial Class MyPasswordReminder
    Inherits PasswordRecovery

    Protected Overrides Sub OnVerifyingUser(e As System.Web.UI.WebControls.LoginCancelEventArgs)
        MyBase.OnVerifyingUser(e)
        'Do my stuff here
    End Sub

End Class

And here is how I’m adding it to the page.

 Private Sub Page_Init(sender As Object, e As System.EventArgs) Handles Me.Init
   Dim passwordRecoveryControl As New MyPasswordReminder
   passwordRecoveryControl.ID = "passwordRecoveryControl1"
   Placeholder1.Controls.Add(passwordRecoveryControl)
 End Sub

The UI code is just a simple:

<asp:Panel runat="server" ID="pnlMakeDefault" >
  <asp:Placeholder ID="Placeholder1" runat="server"/>
</asp:Panel>

At runtime I get the following error:

DefaultSource Error: 2 : An entry with
the same key already exists. An entry
with the same key already exists.

Full error:

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. Information regarding the
origin and location of the exception
can be identified using the exception
stack trace below.

Stack Trace:

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

Does anyone know why? I suspect it’s something to do with the validation controls in the base class of the password recovery control but I’m a bit at a loss as to how to proceed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:46:08+00:00Added an answer on May 22, 2026 at 1:46 am

    Not exactly sure why it was an issue but eventually I found that setting the ClientID mode of the control to AutoID solved the problem. My suspicion is that there were validation controls being generated by the control that had conflicting identities but I wasn’t able to prove it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a subclass of asp:DropDownList so I can use asp:DdlNoEventValidation
I am trying to subclass CCSprite but for some reason I can't seem to
I'm trying to subclass str , but having some difficulties due to its immutability.
I am simply trying to subclass UIWindow so that I can intercept some notifications.
I'm trying to draw an NSTextFieldCell subclass that looks like the rounded event item
I'm trying to subclass an WinApi edit control and override the paint method .
I am trying to subclass a deque, but can't work out how to set
I am trying to subclass the window that currently has focus. I do this
I'm trying to create a subclass of JButton or AbstractButton that would call specified
I have a UIViewController subclass that I am trying to have handle the shake

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.