Protected WithEvents Control Declarations Missing in VS2005

Posted on 2006-05-02
Last Modified: 2008-01-09
I am attempting to expose Controls and their properties to a base class handler.  I have not been successful, so I thought it might be that my controls were not publicly exposed in the page.

For example, if I type....

Public WithEvents ImageA as System.Web.UI.WebControls.Image

I get an error:

"ImageA is already declared as 'Protected Dim WithEvents ImageA as System.Web.UI.WebControls.Image' in this class"

Okay, great!  Where is it so I can change it from "Protected" to "Public" ???

Question by:born4code
    LVL 17

    Accepted Solution

    in vs2005 the class can be divided in two parts... and when you build an form the declarations code is separated of the programmer code... just go the declarations part of the form
    LVL 17

    Expert Comment

    LVL 2

    Author Comment

    "just go the declarations part of the form"

    I would love to.  I cannot find anything like that.  The article you point to says that you can simply "Show All Files" from the object browser.  I've done that and it does not show up there either.

    LVL 2

    Author Comment


    Well.. nobody responded to this one.
    I have finally discovered that this issue is by design with the "web site" project in VS2005.
    There is now a fix available.

    still giving you the points... the only one who had the guts to take this one on?


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
    In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now