SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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" />
share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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