Referencing custom controls in VS.net?
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcontrolsvb' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

webmaster@undefined.net
-- This message, which was originally sent to "aspngvs", has been moved to "aspngcontrolsvb" mailing list by the List Master --

I'm at my wit's end... I've made a custom server control in Visual Studio as
a .vb file, put it in its own namespace, and attempted to reference it in an
aspx file. Every time I attempt to do this I get a parser error. I am
using the following syntax in the top of my aspx file:

<%@ Register TagPrefix="mycontrol" Namespace="MyNamespace"
Assembly="SolutionName" %>

and then calling it using a <mycontrol:newcontrol
runat="server"></mycontrol:newcontrol>. I built everything before running
it. What step did I miss? There's no documentation on this in MSDN or in
the official docs, so you guys are pretty much my only hope at this point.
Any help at all is appreciated.

ps - I'm a newbie when it comes to ASP; though I've programmed in VB and PHP
before, this whole environment is new to me, so the simpler the better.
Thanks.

Reply to this message...
 
    
Brian Bilbro (VIP)
The ASP.NET fines controls is looking at the bin directory at the root of
the *application*. If you ASP.NET application is:
c:\inetpub\wwwroot\myapp\

then make sure you put your compiled dll in the bin directory underneath
that:
c:\inetpub\wwwroot\myapp\bin

The dll most likely was compiled in theVisual Studio.NET project bin
directory. Just copy the dll over the asp.net application bin directory.

HTHs,
Brian

----- Original Message -----
From: "Click here to reveal e-mail address" <Click here to reveal e-mail address>
To: "aspngcontrolsvb" <Click here to reveal e-mail address>
Sent: Wednesday, July 18, 2001 8:15 PM
Subject: [aspngcontrolsvb] Referencing custom controls in VS.net?

> -- This message, which was originally sent to "aspngvs", has been moved to
"aspngcontrolsvb" mailing list by the List Master --
[Original message clipped]

Reply to this message...
 
    
webmaster@undefined.net
Nope, the dll is there. Does VS.net compile it for you when you add a new
namespace and build the file? If not, then I need to know how to do that.
If so, then what else could it be? Any help at all would be appreciated.
Thanks.

----- Original Message -----
From: "Brian Bilbro" <Click here to reveal e-mail address>
To: "aspngcontrolsvb" <Click here to reveal e-mail address>
Sent: Wednesday, July 18, 2001 5:33 PM
Subject: [aspngcontrolsvb] Re: Referencing custom controls in VS.net?

[Original message clipped]

Reply to this message...
 
    
Brian Bilbro (VIP)
So,
1. You moved the dll to the bin directory?
2. Or is your VS.NET project file directory that same as the ASP.NET
application? If they are not, then the dll is compiled in the Visual
Studio.net project bin directory when you build it.

Also, note that the assembly name is usually the name of the dll (the vs.net
project name). Is the dll name the same as the assembly name you reference
(SolutionName)?

--
Brian
----- Original Message -----
From: "Click here to reveal e-mail address" <Click here to reveal e-mail address>
To: "aspngcontrolsvb" <Click here to reveal e-mail address>
Sent: Wednesday, July 18, 2001 8:57 PM
Subject: [aspngcontrolsvb] Re: Referencing custom controls in VS.net?

[Original message clipped]

Reply to this message...
 
    
webmaster@undefined.net
2. The dll is made where it's supposed to be. And yes, the assembly name
is the same as the solution name (hence SolutionName). Nevertheless, the
parser continues to tell me that it can't load the type I'm referring to.

----- Original Message -----
From: "Brian Bilbro" <Click here to reveal e-mail address>
To: "aspngcontrolsvb" <Click here to reveal e-mail address>
Sent: Wednesday, July 18, 2001 6:08 PM
Subject: [aspngcontrolsvb] Re: Referencing custom controls in VS.net?

[Original message clipped]

Reply to this message...
 
    
Matthew Merrill
Have you tried putting in your ID attribute on your control.
For example: <mycontrol:newcontrol id&#"S;omeControl" runat&#"s;erver" />
You should then see a control reference declaration in your code behind. If
it isn't there, then you need to manually add it.

Matthew Merrill
Apriso Corporation

-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]
Sent: Thursday, July 19, 2001 10:45 AM
To: aspngcontrolsvb
Subject: [aspngcontrolsvb] Re: Referencing custom controls in VS.net?

2. The dll is made where it's supposed to be. And yes, the assembly name
is the same as the solution name (hence SolutionName). Nevertheless, the
parser continues to tell me that it can't load the type I'm referring to.

----- Original Message -----
From: "Brian Bilbro" <Click here to reveal e-mail address>
To: "aspngcontrolsvb" <Click here to reveal e-mail address>
Sent: Wednesday, July 18, 2001 6:08 PM
Subject: [aspngcontrolsvb] Re: Referencing custom controls in VS.net?

[Original message clipped]

| [aspngcontrolsvb] member Click here to reveal e-mail address &# Y;OUR ID
| http://www.asplists.com/asplists/aspngcontrolsvb.asp &# J;OIN/QUIT
| http://www.asplists.com/search &# S;EARCH Archives
Reply to this message...
 
    
webmaster@undefined.net
RE: [aspngcontrolsvb] Re: Referencing custom controls in VS.net?What do you
mean by a control reference declaration? Adding an ID to the control
changes nothing, it still can't find the class.

----- Original Message -----
From: Matthew Merrill
To: aspngcontrolsvb
Sent: Thursday, July 19, 2001 1:37 PM
Subject: [aspngcontrolsvb] Re: Referencing custom controls in VS.net?

Have you tried putting in your ID attribute on your control.
For example: <mycontrol:newcontrol id="SomeControl" runat="server" />
You should then see a control reference declaration in your code behind. If
it isn't there, then you need to manually add it.
Matthew Merrill
Apriso Corporation
-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]
Sent: Thursday, July 19, 2001 10:45 AM
To: aspngcontrolsvb
Subject: [aspngcontrolsvb] Re: Referencing custom controls in VS.net?
2. The dll is made where it's supposed to be. And yes, the assembly name
is the same as the solution name (hence SolutionName). Nevertheless, the
parser continues to tell me that it can't load the type I'm referring to.
----- Original Message -----
From: "Brian Bilbro" <Click here to reveal e-mail address>
To: "aspngcontrolsvb" <Click here to reveal e-mail address>
Sent: Wednesday, July 18, 2001 6:08 PM
Subject: [aspngcontrolsvb] Re: Referencing custom controls in VS.net?

[Original message clipped]

| [aspngcontrolsvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcontrolsvb.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
| [aspngcontrolsvb] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngcontrolsvb.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com