Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Server control on non-compiled .aspx page

Reply
Thread Tools

Server control on non-compiled .aspx page

 
 
Gordo
Guest
Posts: n/a
 
      02-01-2005
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?

 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      02-01-2005
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

"Gordo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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?
>



 
Reply With Quote
 
 
 
 
Gordo
Guest
Posts: n/a
 
      02-01-2005
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

 
Reply With Quote
 
David Jessee
Guest
Posts: n/a
 
      02-02-2005
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


"Gordo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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?
>



 
Reply With Quote
 
Jason Kendall
Guest
Posts: n/a
 
      02-02-2005
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
http://www.velocityreviews.com/forums/(E-Mail Removed)



On 1 Feb 2005 06:07:13 -0800, "Gordo" <(E-Mail Removed)> wrote:

>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


 
Reply With Quote
 
Gordo
Guest
Posts: n/a
 
      02-03-2005
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!

 
Reply With Quote
 
Jason Kendall
Guest
Posts: n/a
 
      02-04-2005
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 Removed)


On 3 Feb 2005 09:57:23 -0800, "Gordo" <(E-Mail Removed)> wrote:

>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!


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to refer a control in the host page from a user control if the host page using masterpage Jerry Qu ASP .Net 1 02-20-2009 07:41 PM
edit attribute values of a web control just before control rendered to the page (control's Load event?) TJ ASP .Net Web Controls 4 04-07-2006 01:30 AM
accessing the web user control's control from a web page and set a value from another web page Reny J Joseph Thuthikattu ASP .Net 1 12-30-2004 12:21 PM
Add control to asp:PlaceHolder on asp.net page from user control on same page Dan ASP .Net 1 01-04-2004 08:14 PM
HTML Client Control versus. HTML Server Control versus. Web Server Control Matthew Louden ASP .Net 1 10-11-2003 07:09 PM



Advertisments