Last post Jul 12, 2005 08:53 AM by joteke
Jul 11, 2005 08:27 AM|firemyst|LINK
I have the following web control class library and aspx page. I've compiled the vb code into a class library (compiles fine), and copied the resulting dll into the "bin" directory of the aspx project. I'm using Visual Studio .NET.
The error I receive when trying to run the aspx page is:
Could not load type myControls.ShowColor from assembly ShowColor, Version=1.0.2018.13096, Culture=neutral, PublicKeyToken=null.
Why won't this work?
<%@ Register TagPrefix="myControls" Namespace="myControls" Assembly="ShowColor"%>
ShowColor vb code:
Public Class ShowColor : Inherits Control
Public Text As String
Public Color As String
Protected Overrides Sub Render(ByVal objTextWriter As HtmlTextWriter)
Jul 11, 2005 10:19 AM|llangleyben|LINK
Jul 11, 2005 11:45 AM|firemyst|LINK
Jul 12, 2005 06:18 AM|llangleyben|LINK
Jul 12, 2005 06:41 AM|firemyst|LINK
Add your new control to VS toolbox. Do you see it?
Add control to your test page by druging it from toolbox, this will add required references to your project.
Let us know if youmaking progress.
Jul 12, 2005 07:43 AM|llangleyben|LINK
Jul 12, 2005 08:12 AM|firemyst|LINK
Right click on toolbox, Add/Remove Items, browse to your control assembly and select if.
Jul 12, 2005 08:53 AM|joteke|LINK
the prefix you declare in @Register directive maps to the namespace. What you give in aspx within CC1:SHOWCOLOR is the class name of the control. So you can think of it as
namespace_prefix : classname. So as you see in this light, only prefix would only tell the namespace within the assembly, but not which control in that namespace it is in question. That's why you need also the class name (or type name, which term you