LoadControl problem - External Controls

Discussion in '.NET' started by lennart, Apr 24, 2010.

  1. lennart

    lennart

    Joined:
    Apr 24, 2010
    Messages:
    2
    Likes Received:
    0
    Hi

    I have been using the LoadControl for ages but has recently got a problem in a new project

    I have created a small CMS system where users should be able to create their own controls to extend the system, but when I load the controls using the LoadControl method I get an error "Could not load type xxx"

    I have googled for too long now and hope for some help.

    This is what I want to do.

    The Website is installed on my server. The users sign up and get their own website area. It comes standard with a lot of controls, but I want to be able to let the users extend it further. Somewhat like DotNetNuke

    When the user has created their control they should upload it to a folder on the website. ie. Users/12/Controls/

    The user uploads the ascx and cx and designer files to the folder. Just like the Visual Studio 2008. The site is running .NET 3.5

    The I could like to load the control when their page is displayed, but this is where the problem starts.

    I simply can get it to load. Does the control needs to be compiled and how do I do this ? or am I missing something vital.

    I really hope for your help on this one.

    Cheers
    Lennart
     
    lennart, Apr 24, 2010
    #1
    1. Advertisements

  2. lennart

    lennart

    Joined:
    Apr 24, 2010
    Messages:
    2
    Likes Received:
    0
    Found the solution

    hi

    I searched again and found this super cool article. Its so simple and the drawbacks are none, as far as I can see. This is real reuse without the need to compile to single assemblies or using ParseControl.

    The solution is the AssemblyResourceProvider. Look at the link here.

    But I cant add links to this post so search google for
    "ASP.NET: Reusing Web User Controls and Forms"

    Its ranked as number 1

    Cheers
     
    lennart, Apr 25, 2010
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.