0

I have created a custom Button with some extra properties. I want to register it in my Application Page like this

<%@ Register Namespace="Test1.Test2.Helpers" Assembly="Test1.Test2" TagPrefix="test" %>

But it casts an exception and saying something like it cannot find the assembly.

1

1 Answer 1

1

You need to deploy the assembly to GAC and use the fully qualified Name in assembly tag as:

<%@ Register Tagprefix="MyControls" 
    Namespace="KM.MyControls.MyControl" 
    Assembly="KM.MyControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<Your token>" %>

Then you can reference your User Control

   <MyControls:MyUserControl runat="server"/>
4
  • It is same assembly which contains the application page so it must be GAC:ed ? and I just added a useul class which inherits from Button class
    – Medes
    Sep 22, 2014 at 15:57
  • add the "Test1.Test2" assembly to GAC.
    – Aanchal
    Sep 22, 2014 at 15:59
  • It is not User Control, It is a normal class which is derived from Button and it is in the same project that contains the Application Page (SharePoint Project) which is already GAC:ed
    – Medes
    Sep 23, 2014 at 7:59
  • So just add fully qualified name to your assembly tag.
    – Aanchal
    Sep 23, 2014 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.