the asp.net application doesn't compile it self under the /bin directory, where it is?

U

Umut Tezduyar

I want to use my custom control (.cs) in my web application. Custom control
is in the same assembly as my application. I want to know the name of the
assembly (.dll) file so i can add it's <@Pegister Assembly="abc.dll"> name.
But in asp.net 2.0 i can't find the assembly. It is not compiled under the
/bin folder. Where it is, or how can i give a reference to it?
 
J

Juan T. Llibre

re:
I want to use my custom control (.cs) in my web application.

Custom controls aren't located in *.cs files.
Classes are included in *.cs files.

Can you clarify what you are looking for ?
 
U

Umut Tezduyar

I mean, not the *.ascx (User controls), custom control.

Let me ask my question in this way: I can't add my custom control in a web
page because i don't know what to write in the <@Page Assembly=''> register
tag.
 
J

Juan T. Llibre

OK...

For that, check out :
http://support.microsoft.com/default.aspx?scid=kb;en-us;321749

The proper tag is :
<%@ Register TagPrefix="Custom" Namespace="CustomControlNamespace" Assembly= "CustomControl" %>

Custom is an alias that you associate with a namespace.
CustomControlNamespace is a namespace in which classes of an assembly are enclosed.
CustomControl is the name of the assembly file without an extension (.dll).
 
S

Scott Allen

I want to use my custom control (.cs) in my web application. Custom control
is in the same assembly as my application.

Is this 2.0? (I assume so based on your previous questions). Your
custom control must be in App_Code, correct?

Something like this:

namespace OTC
{
public class MyCustomControl : WebControl
{
protected override void Render(HtmlTextWriter writer)
{
writer.Write("This is my custom control");
base.Render(writer);
}
}
}

I want to know the name of the
assembly (.dll) file so i can add it's <@Pegister Assembly="abc.dll"> name.
But in asp.net 2.0 i can't find the assembly. It is not compiled under the
/bin folder. Where it is, or how can i give a reference to it?

ASP.NET builds App_Code as a separate assembly, and the runtime will
recognize "App_Code" as an assembly name in a reference directive.

<%@ Register Assembly="App_Code" TagPrefix="otc" Namespace="OTC" %>

....

<otc:MyCustomControl runat="Server" id="boo" />
 

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

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top