p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Customer Server Control...


Message #1 by "Jason Richmeier" <jrichmeier@c...> on Mon, 11 Nov 2002 15:07:48
I am attempting to create a custom server control and use it in a .ascx 
file and its associated code behind file.  It is my understanding that a 
custom server control has to be enclosed in a namespace declaration.

I have included the following lines in the .ascx file:

<%@ register tagprefix="cc" namespace="testnamespace" 
assembly="customcontrols" %>

<cc:testControl id="testObject" runat="server"></cc:testControl>

I have included the following line in the code behind file:

Public testObject As [RootNameSpace].testNameSpace.testControl

When I try to view the page, I get the following error message:

The base class includes the field 'testObject', but its type 
([RootNameSpace].testNameSpace.testControl) is not compatible with the 
type of control (testNameSpace.testControl).

I am not sure what this error message is trying to tell me.  My guess was 
that it thinks that [RootNamespace].testNameSpace.testControl and 
testNameSpace.testControl are two different data types.  If this is the 
case, I have no idea how to resolve the conflict.  If anyone can provide 
assitance or has some sample code that does something like what I am 
trying to do that they are willing to share it would be greatly 
appreciated.

Thanks in advance,

Jason Richmeier

  Return to Index