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
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