[ASP.Net 2.0] Loading ascx-file located outside webscope

Discussion in 'ASP .Net' started by Jesper Stocholm, Mar 30, 2006.

  1. I would like to be able to load a Control (ASCX) that is placed in a folder
    outside webscope - but with read/write ability for IUSR/ASPNET-process. I
    usually use Page.LoadControl() to load my controls [0], but this method
    requires a _virtual_ path - and it does not permit paths that go "above"
    the root folder of the virtual directory/website.

    Is there a way arround this?

    I need it since I am building a small CMS that will allow the admin-users
    to either upload their own controls via FileUpload or have the CMS create
    the control-file/code itself. If I cannot work around this, I will need to
    create write-permissions on a folder within webscope, and for security-
    reasons I do not like to do this.

    Any help will be greatly appreciated..

    :eek:)

    [0] Using Page.LoadControls("~/controldir/mycontrol.ascx");

    --
    Jesper Stocholm
    http://stocholm.dk
    Copenhagen, Denmark
     
    Jesper Stocholm, Mar 30, 2006
    #1
    1. Advertising

  2. Jesper,

    Loading controls on the fly good job. Here's a couple links that you can
    use to help with this. Sorry neither of them do exactly what you want. The
    second link does come extremely close.

    The title on this link is missleading. You'll see when you get there. Look
    for the portal stuff. http://msdn2.microsoft.com/en-us/library/ms233955.aspx

    Way down at the bottom of this page with the import catalog webpart users
    can add webparts to a webpart portal (webpart is just a user control in a
    webpart wrapper code)
    http://www.c-sharpcorner.com/Upload...ht08042005042119AM/Building_WebParts.mht.aspx

    Good Luck
    DWS


    "Jesper Stocholm" wrote:

    > I would like to be able to load a Control (ASCX) that is placed in a folder
    > outside webscope - but with read/write ability for IUSR/ASPNET-process. I
    > usually use Page.LoadControl() to load my controls [0], but this method
    > requires a _virtual_ path - and it does not permit paths that go "above"
    > the root folder of the virtual directory/website.
    >
    > Is there a way arround this?
    >
    > I need it since I am building a small CMS that will allow the admin-users
    > to either upload their own controls via FileUpload or have the CMS create
    > the control-file/code itself. If I cannot work around this, I will need to
    > create write-permissions on a folder within webscope, and for security-
    > reasons I do not like to do this.
    >
    > Any help will be greatly appreciated..
    >
    > :eek:)
    >
    > [0] Using Page.LoadControls("~/controldir/mycontrol.ascx");
    >
    > --
    > Jesper Stocholm
    > http://stocholm.dk
    > Copenhagen, Denmark
    >
     
    =?Utf-8?B?RFdT?=, Mar 30, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Quentin
    Replies:
    1
    Views:
    497
    Quentin
    Jul 29, 2003
  2. Kristoffer Arfvidson
    Replies:
    7
    Views:
    603
    Shiv Kumar
    Jan 21, 2004
  3. Holger (David) Wagner
    Replies:
    2
    Views:
    1,955
    Holger (David) Wagner
    Jul 3, 2004
  4. Jacob Donajkowski
    Replies:
    0
    Views:
    501
    Jacob Donajkowski
    Mar 7, 2007
  5. Nathan Sokalski
    Replies:
    1
    Views:
    597
    miher
    Jun 15, 2009
Loading...

Share This Page