Using controls across multiple virtual directories

P

Paul Hodgson

Is there any easy way to have .ascx controls used by pages in different
virtual directories?

My situation is that I have some pages that need to be accessed using SSL -
so I've put these pages in a separate virtual directory that is set up in
IIS to require secure access. Trouble is however that these pages need to
use some of the same .ascx controls that my non-secure pages need (and which
are therefore located in the root directory, where my non-secure pages are).
And every time I try to register the controls in the secure .aspx files,
VS.NET complains that I'm not
allowed to use controls in different applications or virtual directories.

Any help appreciated :)

Paul
 
E

Egbert Nierop \(MVP for IIS\)

Paul Hodgson said:
Is there any easy way to have .ascx controls used by pages in different
virtual directories?

My situation is that I have some pages that need to be accessed using SSL -
so I've put these pages in a separate virtual directory that is set up in
IIS to require secure access. Trouble is however that these pages need to
use some of the same .ascx controls that my non-secure pages need (and which
are therefore located in the root directory, where my non-secure pages are).
And every time I try to register the controls in the secure .aspx files,
VS.NET complains that I'm not
allowed to use controls in different applications or virtual directories.

ASP.NET allows to share source by pointing to the correct .cs code but they
will be and should be compiled for their own assemblies.

It would be the best thing to create your controls as separate
control-library, compile that, and distribute that assembly among your
asp.net apps.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top