Reference a user control in another project

H

Hermit Dave

To what i remember reading from the books on user controls you can. They are
bound to the project and cannot be reference with URL
If its going to be used in multiple projects then it is advised that you
either custom web controls

Since they are assembilies and if you go to the extent of Strong Naming them
then you can add them to GAC and dont have to worry bout its path... Just
add a referece and you are sorted.

Regards,

Hermit Dave
 
H

Hermit Dave

if you choose to write your own webcontrol you have two options
1. Composite control where you just create child components and delegate the
calls
2. Custom - where you do everything from the scratch... including emitting
the correct html

Have fun...

Hermit Dave
 
M

mg

Ken,

WebUserControl:

<%@ Control Language="c#" AutoEventWireup="false"
ClassName="WebUserControl1" %>

-----------------------------------------

WebUserControl.ascx placed in C:\Inetpub\Q

-----------------------------------------

In Internet Information Services:

New / Virtual Directory

Alias: Q
Directory: C:\Inetpub\Q

Properties: Remove Q

-----------------------------------------

WebForm:

<%@ Register TagPrefix="HDR" TagName="Head"
Src="Q/WebUserControl1.ascx" %>

<%@ Page language="c#" Codebehind="WebFormASCX.aspx.cs"
AutoEventWireup="false" Inherits="Deploy.WebFormASCX" %>


Running the WebForm results in the following error message:


Parser Error Message: Could not find a part of the
path "c:\inetpub\wwwroot\Deploy\Q\WebUserControl1.ascx".

-----------------------------------------

Can you [or Jim] see my error?

MG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top