473,765 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.LoadContro l() 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..

:o)

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

--
Jesper Stocholm
http://stocholm.dk
Copenhagen, Denmark
Mar 30 '06 #1
1 1481
DWS
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/UploadF...Parts.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.LoadContro l() 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..

:o)

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

--
Jesper Stocholm
http://stocholm.dk
Copenhagen, Denmark

Mar 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3358
by: John Cosmas | last post by:
I've got a page which loads up a different user control into a placeholder control every time a button is clicked on the parent page. I use a statement like Me.plcTabViews.Controls.Add(LoadControl("test.ascx")). There are up to 30 possibilities which are decided by CASE statements and keeps one from loading up onto another. However, I'm running into a unique error... Failed to load viewstate. The control tree into which viewstate is...
1
928
by: Bogdan Nedelcu | last post by:
Hello, I have a asp.net project with some aspx and a lot of ascx. The IIS memory grows as it compile each item. I saw in the temporary files that for each aspx, ascx there are arount 4 files generated, one of them being a DLL. Is there a way to precompile everything in one single DLL. The loading time would be shorter, etc. I saw that in 2.0 there is the aspnet_compile.exe. Is there such a feature
7
3195
by: Samuel | last post by:
Hi, I am building a page that makes use of user control as a templating technique. The following is that I have in mind and it is actually working: Root/ -- login.aspx -- login.aspx.vb -- UC/ ----- Classic/
5
2783
by: footballhead | last post by:
I have a site that has MANY different clothing categories. I have a page set up for displaying the products (productsearch.aspx) when a user clicks one of the category links on the navigation menu. I would like to have a different user control that gets loaded as a sub-header for each category (ie, tee shirts, shoes, backpacks, etc.) The category user controls include images and links to refined searches specific to each category. So...
3
1556
by: Wouter | last post by:
Hi All, I am loading a web user control (.NET 2.0) into a placeholder on a content page ( plus the use of a master page). The controls is a list of companie, one you select a company for editing, the edit button loads the "editcompany.ascx" control into the placeholder which was just occupied by the "companylist.ascx" control. This all works just fine, but I gues you see my problem coming.... as soon
1
1841
by: Bob Rock | last post by:
Hello, I'm new to ASP.NET and I've been looking into the topic of dynamically loading (typically accomplished with a LoadControl followed by a MyControl.Controls.Add()) both user controls and asp.net web controls. I searched for articles on the internet and in the end I must say that I'm confused. I read about issues related to: a.. events not firing
3
9658
by: Bert | last post by:
Hi I am trying to load my user control in a placeholder, i get an error: c:\inetpub\wwwroot\testinline\WebForm2.aspx.vb(26): Type 'WebUserControl6' is not defined? Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
1
1052
by: itfetish | last post by:
Accidentally put this in normal ASP newsgroup, so reposting: I'm just starting out with ASP.net, making a web parts intranet. I'm triyng to get some basic web parts (ascx files) working on a page, I want them to share a variable, 'StaffID' which one part generates by looking up the windows login name of the person viewing the page, and then queries the database to find out the StaffID associated with that name.
2
15071
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have been able to find the cause of the problem, and will describe it here first textually and then through a code example. The purpose of what I am trying to do is to create a postback-free web application through the use of ASP.net AJAX UpdatePanels...
1
1674
by: =?Utf-8?B?QU5lZWxpbWE=?= | last post by:
I am using the asp.net 2.0 wizard with 5 steps and would like to do the following: Load a different .ascx (control) into each of the 5 steps I can load them fine but I notice that every time I navigate between steps, the entire UI 'flickers'. By debugging the problem, I noticed that the page_load event for each of the controls is called each time I click 'Next' or 'Previous' in the wizard
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9955
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9833
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.