Widget as Custom control: Could not resolve type for tag &qu

Posted by Community Admin on 05-Aug-2018 18:24

Widget as Custom control: Could not resolve type for tag "sf:radrotator". Make sure the proper namespace is registered

All Replies

Posted by Community Admin on 30-Dec-2010 00:00

Hi
I'm following the documentation for building a widget as a custom control, and i'm getting the error below when I try to compile and run:
Could not resolve type for tag "sf:radrotator". Make sure the proper namespace is registered

[ArgumentException: Could not resolve type for tag "sf:radrotator". Make sure the proper namespace is registered.] Telerik.Sitefinity.Web.UI.Templates.TemplateParser.ResolveType(String tag) +606

When looking at the Rotator.ascx file the tag <sf:RadRotator... is underlined with a validation error (not a known element). This is also the case when looking at the NewsRotator control in the default sample application (Telerik.Sitefinity.Sdk.Examples).

The line <%@ register tagprefix="sf" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %> is included at the top of the ascx file and the relevant dlls are added as references. Am I missing something else?

Posted by Community Admin on 31-Dec-2010 00:00

Hello Ryan,

Please check whether the template has been built as an EmbeddedResource. You could also try to register a prefix for Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" inside the web.config and then rebuild the project in Visual Studio. Make sure that the class library has a reference to Telerik.Web.UI.

Regards,
Ivan Dimitrov
the Telerik team


Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 04-Jan-2011 00:00

Thanks Ivan - i've checked all of this, but the problem still occurs. As I mentioned, this is also occuring in the sample project provided with Sitefinity.

Posted by Community Admin on 04-Jan-2011 00:00

Hello Ryan,

I am not able to replicate this issue locally if Telerik.Web.UI is referenced to the project. I am sending you a short video which shows a custom control that uses RadRotator. The control is populated by a datasource of NewsItems.

Regards,
Ivan Dimitrov
the Telerik team


Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 04-Jan-2011 00:00

Hi Ivan

The video shows part of the problem i'm having - the tags <telerik:RadGrid> and <telerik:RadListView> and <telerik:RadRotator> are all underlined, the tags are not recognized. In my case, this continues over to when I actually run the project. If I delete all code in the control then drag and drop a RadRotator from the Toolbox to the Rotator.ascx, then Visual Studio will register the assembly at the top of the Rotator.ascx control, and will then recognise the telerik tags, with design support. However, i still get the same "tag not recognised" error when I try to add the rotator to a page.

The full stack trace is:

[ArgumentException: Could not resolve type for tag "telerik:radrotator". Make sure the proper namespace is registered.] Telerik.Sitefinity.Web.UI.Templates.TemplateParser.ResolveType(String tag) +606 Telerik.Sitefinity.Web.UI.Templates.TemplateParser.CreateObjectBuilder(HtmlChunk chunk) +171 Telerik.Sitefinity.Web.UI.Templates.TemplateParser.ParseOpenTag(HtmlChunk chunk) +228 Telerik.Sitefinity.Web.UI.Templates.TemplateParser.ParseChunk(HtmlChunk chunk) +86 Telerik.Sitefinity.Web.UI.Templates.TemplateParser.Parse() +191 Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder.ParseHtml(TemplateParser parser) +88 Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder.ParseHtml(String html) +84 Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder..ctor(ObjectBuilder parent, String html) +60 Telerik.Sitefinity.Web.UI.Templates.ObjectBuilder..ctor(ObjectBuilder parent, String html, String templatePath) +40 Telerik.Sitefinity.Web.UI.Templates.ControlBuilder..ctor(ObjectBuilder parent, String html, String templatePath) +43 Telerik.Sitefinity.Web.UI.Templates.RootBuilder..ctor(String templatePath, String html, ObjectBuilder parent) +43 Telerik.Sitefinity.Web.UI.Templates.RootBuilder..ctor(String templatePath, String html) +42 Telerik.Sitefinity.Web.UI.StringTemplate..ctor(String declaration, String templateName) +61 Telerik.Sitefinity.Web.UI.ControlUtilities.GetTemplate(String virtualPath, String resourceFileName, Type assemblyInfo, String templateDeclaration) +1395 Telerik.Sitefinity.Web.UI.ControlUtilities.GetControlTemplate(TemplateInfo info) +875 Telerik.Sitefinity.Web.UI.ControlUtilities.GetTemplate(TemplateInfo info) +1193 Telerik.Sitefinity.Web.UI.SimpleView.get_LayoutTemplate() +261 Telerik.Sitefinity.Web.UI.SimpleView.get_Container() +54 Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +72 System.Web.UI.Control.EnsureChildControls() +102 System.Web.UI.Control.PreRenderRecursiveInternal() +42 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Control.PreRenderRecursiveInternal() +175 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

Posted by Community Admin on 04-Jan-2011 00:00

Ah, got it - it's case sensitive. My VisualStudio settings for the HTMl designer are set to use all lowercase tags. using the correct RadRotator casing allows it to work.
Thanks
Ryan

This thread is closed