Server control on non-compiled .aspx page

Discussion in 'ASP .Net' started by Gordo, Feb 1, 2005.

  1. Gordo

    Gordo Guest

    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?
    Gordo, Feb 1, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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?
    >
    Eliyahu Goldin, Feb 1, 2005
    #2
    1. Advertising

  3. Gordo

    Gordo Guest

    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
    Gordo, Feb 1, 2005
    #3
  4. Gordo

    David Jessee Guest

    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" <> wrote in message
    news:...
    > 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?
    >
    David Jessee, Feb 2, 2005
    #4
  5. 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




    On 1 Feb 2005 06:07:13 -0800, "Gordo" <> 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
    Jason Kendall, Feb 2, 2005
    #5
  6. Gordo

    Gordo Guest

    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!
    Gordo, Feb 3, 2005
    #6
  7. 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



    On 3 Feb 2005 09:57:23 -0800, "Gordo" <> 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!
    Jason Kendall, Feb 4, 2005
    #7
    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. Dave
    Replies:
    2
    Views:
    381
    Raterus
    May 24, 2004
  2. Klaus Schneider
    Replies:
    1
    Views:
    530
    Rolf Magnus
    Dec 2, 2004
  3. Les Caudle
    Replies:
    1
    Views:
    341
    Cowboy \(Gregory A. Beamer\)
    Sep 19, 2006
  4. Replies:
    3
    Views:
    781
    Guillermo
    Apr 26, 2007
  5. lander
    Replies:
    5
    Views:
    581
    bruce barker
    Mar 5, 2008
Loading...

Share This Page