Server control on non-compiled .aspx page

G

Gordo

Hi,

I have written a number of server controls to build the company's
intranet from data held in an Oracle database. Everything works well
for the various navigation pages.

However, the content pages are in the main converted .htm pages with no
code behind. The issue I have is that I wish to place a small
navigation server control on each page. All works well if I compile the
pages with the solution referencing the server control dll. However, I
don't want to create a project out of all the disparate pages as we
just wish to add and remove them without recourse to building a
solution - is this possible?
 
E

Eliyahu Goldin

You can make any changes to deployed aspx pages. As long as you don't change
(or in your case don't use) code-behind, asp.net will pick up changes on
next request and compile the page. You don't need to compile any project or
solution separately.

Eliyahu
 
G

Gordo

Eliyahu,

Thankyou for your quick response! I probably didn't explin things
fully. The issue I have is accessing the Server Control. If I place the
reference in the .aspx page like so,

<%@ Register TagPrefix="cc1" Namespace="WebControlLibrary"
Assembly="WebControlLibrary" %>

and then try to link to this page I get the error (this reference works
fine in compiled projects),

'File or assembly name bin\WebControlLibrary, or one of its
dependencies, was not found.'

I have tried placing the .dll files in the same folder, in a lower
subfolder as the .aspx pages and I have tried creating a web.config
file with the following in it,

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;bin\WebControLibrary"/>
</assemblyBinding>
</runtime>

all to no avail.

I really do not want to compile all the pages into an application if I
can help it!

Any help would be greatly appreciated

Thanks

Gordon
 
D

David Jessee

Look into HTTPModules. You could intercept all of the requests for HTML
docs and modify the result prior to it being sent back to the browser
 
J

Jason Kendall

I'm having a very similar problem. I've been looking all over for the
answer. I know it just cannot be that complex!

In my case, I have a dependency on a library in the GAC (required for
shared use and support for multiple versions).

I tried adding the following to my web.config to no avail
-----------------------------------------------------------------------------------------------
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MyLibrary.Data"
publicKeyToken="af1d58a5db022a2c" culture="neutral"
version="1.0.4.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
-----------------------------------------------------------------------------------------------

If/When I get a response or figure out the answer, I'll send you my
results, in case it helps you out too.


-Jason Kendall
(e-mail address removed)
 
G

Gordo

OK Got it!

My individual .aspx files (non compiled) have been held in a 'normal'
folder under wwwroot. Converting the folder into a virtual folder and
placing the required .dlls in a bin sub-folder did the trick!

Interestingly the <probing privatePath="bin;bin\WebControLibrary"/>
still failed if I placed the .dlls into the bin\WebControLibrary
sub-folder, but that is a minor irritant now.

Another (less favourable) option as it transpired was to place the
..dlls in the bin folder under wwwroot, that done I wouldn't need to
convert the 'normal' folder to a virtual folder.

Thanks for the input guys!
 
J

Jason Kendall

Unfortunately, this will not work for my situation because I have
multiple versions of my DLL in the GAC, from which I need to reference
it, and also because my app must participat in the same session as the
rest of the site, so converting the web folder to a web 'application'
would be bad.

Thanks for the information, though!


-Jason Kendall
(e-mail address removed)
 

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

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top