Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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=1.0.0.0,Culture=neutral,PublicKeyToken=846d0a16c362cfbd" Namespace="SharepointTest" TagPrefix="CC" %>

and the tag

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

In web.config,

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

Did I did anything wrong or miss anything?

Thank you.

share|improve this question
add comment

1 Answer 1

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:

 <controls>
        <add src="/_controltemplates/ControlName.ascx" tagName="MyTagName" tagPrefix="MyTagPrefix" />
</controls>
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
add comment

Your Answer

 
discard

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.