user control in an assembly

Discussion in 'ASP .Net' started by Steve Richter, Apr 22, 2005.

  1. 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
    Steve Richter, Apr 22, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Prasanna Padmanabhan
    Replies:
    1
    Views:
    814
    Mattias Sjögren
    Nov 19, 2003
  2. Brent
    Replies:
    1
    Views:
    1,359
    Brent
    Jan 23, 2004
  3. SA
    Replies:
    0
    Views:
    470
  4. Horatiu Margavan via .NET 247

    Assembly's manifest definition does not match the assembly reference.

    Horatiu Margavan via .NET 247, Aug 30, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    3,607
    Horatiu Margavan via .NET 247
    Aug 30, 2004
  5. Grant Merwitz
    Replies:
    3
    Views:
    9,041
    Grant Merwitz
    Sep 15, 2005
Loading...

Share This Page