user control in an assembly

S

Steve Richter

I have moved a user control from my asp.net web application project
into a separate assembly.

Where I had registered the control this way:
<%@ Register TagPrefix="ac" TagName="ArticleSummary"
Src="ArticleSummary.ascx" %>

Now I register it like so:
<%@ Register TagPrefix="ac" Namespace="AutoCoder.Controls"
Assembly="AutoCoder" %>

When I moved the control into the assembly class library project, I
moved both the .ascx and .ascx.cx files.

The problem is, now the control does not work! Everybody compiles ok,
but when I run it I get an "object reference not set to an instance"
error.

That error occurs when the code in the .ascx.cs file tries to hook the
click event of one of the controls in the .ascx file.

Can the .ascx, .ascx.cs combo be used in an assembly based user
control? How do the references to the controls in the .ascx file get
set or whatever in the code behind class instance in the .ascx.cs file?

( if this is too vague I can post the code. It will be neat to get the
answer to this question! )

thanks,

-Steve
 

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,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top