Loading a usercontrol from a class file?

Posted on 2006-04-28
Last Modified: 2012-08-14
I have a blank ascx user control in my web project that uses the "loadcontrol" method in the code-behind file.

Code-Behind.vb  >>>> LoadControl >>>> UserControl.ascx

Is there another way to use the loadcontrol method without using an ascx code-behind?

For example, can I just use some *class* file elsewhere and direct it to any usercontrol,
or is it required to be in the *code behind* file of the usercontrol?

Class.vb >>>> LoadControl >>>> UserControl.ascx

Doesn't it boil down to the question, can any class inherit a page, etc?

Question by:born4code
    LVL 3

    Accepted Solution

    can you use asp:placeholder for this?

    this will work for 1.1  also.
    LVL 2

    Author Comment

    I am using a placeholder.
    The more I think about this, I think that I asked my question wrong.

    Well, this one was asked wrong... and I am going to have to re-do it.
    I am just going to give you the points, I will do this one again.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 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

    20 Experts available now in Live!

    Get 1:1 Help Now