I am new to SharePoint even ASP.NET.

I wrote a custom calendar control which inherits the asp:calendar and overrides some function, and it work in blank pages. But today while I am trying to use the control in a web part page, it shows unknown server tag.

In both page,

< %@ Register Assembly="SharepointTest,Version=,Culture=neutral,PublicKeyToken=846d0a16c362cfbd" Namespace="SharepointTest" TagPrefix="CC" %>

and the tag

< CC:EventCalendar runat="server" >< /CC:EventCalendar >

In web.config,

< SafeControl Assembly="SharepointTest, Version=, Culture=neutral, PublicKeyToken=846d0a16c362cfbd" Namespace="SharepointTest" TypeName="*" Safe="True" />

Did I did anything wrong or miss anything?

Thank you.


When it comes to web part pages, things work a bit differently. What I always do and I know it's not the safest, but it's the only way that works for me, is to declare the control in the controls section in your web.config:

        <add src="/_controltemplates/ControlName.ascx" tagName="MyTagName" tagPrefix="MyTagPrefix" />
  • Thank you! It is working on the pages now. But still showing error on spd. But I think its good enough for me now.=] – Kris Tsui Jan 14 '13 at 0:22
  • Yeah, SPD is another trick to get it working.. Glad it helped – Fox Jan 14 '13 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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