Re: How to reference custom control from App_Code folder?



If you reference it from App_Code you need to omit the Assembly part of the
Regioster directive, since it's not in an named assembly.

<%@ Register TagPrefix="Fred" Namespace="FredECommerceControls" %>

E.g just have TagPrefix and the namespace declared.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Alan Silver" <alan-silver@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:QUeMD+Fv425DFwdT@xxxxxxxxxxxxxxxxxxxxxx
Hello,

I have a custom control that is inside a DLL. Until now, I have had the
source file for this DLL in a development folder on my machine, and I've
been compiling it using csc on the command line. I reference the control
in the DLL on a master page by adding the line to the top of the file...

<%@ Register TagPrefix="Fred" Namespace="FredECommerceControls"
Assembly="ECommControls" %>

...and then something like this where I want the control...

<Fred:SiteLinks PreSep="" runat="server" />

This all worked fine, but didn't let me debug the control in VWD as it
didn't have the source file.

I tried creating an App_Code folder and putting the source file in there
(deleting the DLL from the bin folder), but this gave the following error
when I tried to run the page...

Element 'SiteLinks' is not a known element. This can occur if there is a
compilation error in the Web site.

I presume that it's not compiling the source file, so it can't find the
assembly containing the control. The question is, why? I thought the whole
idea of putting the source file in App_Code was so that it would
automatically be compiled.

Anyone any ideas? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)


.



Relevant Pages

  • How to reference custom control from App_Code folder?
    ... Until now, I have had the source file for this DLL in a development folder on my machine, and I've been compiling it using csc on the command line. ... I reference the control in the DLL on a master page by adding the line to the top of the file... ... I tried creating an App_Code folder and putting the source file in there, but this gave the following error when I tried to run the page... ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Fortran module checking
    ... Is it as simple as (mind you I'm using xlf90) ... variable.f psuedocode ... Compiling a source file that USEs a module requires the ...
    (comp.lang.fortran)
  • Re: Fortran module checking
    ... Is it as simple as (mind you I'm using xlf90) ... Compiling a source file that USEs a module requires the ... Ken dot And dot Ann ...
    (comp.lang.fortran)
  • Re: Help tracking error
    ... You should produce debug information for the DLL, ... on the target system. ... You might be asked for the path to the source file. ...
    (microsoft.public.vc.debugger)
  • Re: Linking a LIB file
    ... <apellerin AT adeneo DOT adetelgroup DOT com> ... The dll source file contains: ... I even have a .def file for this dll file ... libraries. ...
    (microsoft.public.windowsce.embedded)