1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Invalid Property

Invalid Property

2 posts, 0 answered
  1. Garry
    Garry avatar
    52 posts
    Registered:
    04 Nov 2010
    22 Apr 2009
    Link to this post
    Ok I have been trying to figure out why the code below keeps throwing this error.

    Server Error in '/KCDC' Application.  
    --------------------------------------------------------------------------------  
     
    Invalid Property.   
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.   
     
    Exception Details: System.FormatException: Invalid Property.  
     
    Source Error:   
     
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.    
     
    Stack Trace:   
     
     
    [FormatException: Invalid Property.]  
       Telerik.Cms.Web.UI.Templates.PropertyBuilder..ctor(PropertyDescriptor descriptor, PropertiesBuilder parent) +328  
       Telerik.Cms.Web.UI.Templates.PropertiesParser.CreatePropertyBuilder(HtmlChunk chunk, PropertyDescriptor propDescr) +173  
       Telerik.Cms.Web.UI.Templates.PropertiesParser.ParseOpenTag(HtmlChunk chunk) +352  
       Telerik.Cms.Web.UI.Templates.TemplateParser.ParseChunk(HtmlChunk chunk) +122  
       Telerik.Cms.Web.UI.Templates.TemplateParser.Parse() +197  
       Telerik.Cms.Web.UI.Templates.ObjectBuilder.ParseHtml(TemplateParser parser) +130  
       Telerik.Cms.Web.UI.Templates.PropertiesBuilder.ParseHtml(String html) +77  
       Telerik.Cms.Web.UI.Templates.ObjectBuilder..ctor(ObjectBuilder parent, String html) +71  
       Telerik.Cms.Web.UI.Templates.ObjectBuilder..ctor(ObjectBuilder parent, String html, ResourceManager resourceManager) +52  
       Telerik.Cms.Web.UI.Templates.PropertiesBuilder..ctor(String html, ObjectBuilder parent) +54  
       Telerik.Cms.Web.UI.Templates.TemplateParser.FinalizeCurrentBuilder() +300  
       Telerik.Cms.Web.UI.Templates.TemplateParser.ParseCloseTag(HtmlChunk chunk) +233  
       Telerik.Cms.Web.UI.Templates.TemplateParser.ParseChunk(HtmlChunk chunk) +516  
       Telerik.Cms.Web.UI.Templates.TemplateParser.Parse() +197  
       Telerik.Cms.Web.UI.Templates.ObjectBuilder.ParseHtml(TemplateParser parser) +130  
       Telerik.Cms.Web.UI.Templates.ObjectBuilder.ParseHtml(String html) +119  
       Telerik.Cms.Web.UI.Templates.ObjectBuilder..ctor(ObjectBuilder parent, String html) +71  
       Telerik.Cms.Web.UI.Templates.ObjectBuilder..ctor(ObjectBuilder parent, String html, ResourceManager resourceManager) +52  
       Telerik.Cms.Web.UI.Templates.ControlBuilder..ctor(ObjectBuilder parent, String html, ResourceManager resourceManager) +55  
       Telerik.Cms.Web.UI.Templates.RootBuilder..ctor(ResourceManager resourceManager, String html, ObjectBuilder parent) +55  
       Telerik.Cms.Web.UI.Templates.TemplateParser.FinalizeCurrentBuilder() +356  
       Telerik.Cms.Web.UI.Templates.TemplateParser.ParseCloseTag(HtmlChunk chunk) +233  
       Telerik.Cms.Web.UI.Templates.TemplateParser.ParseChunk(HtmlChunk chunk) +516  
       Telerik.Cms.Web.UI.Templates.TemplateParser.Parse() +197  
       Telerik.Cms.Web.UI.Templates.ObjectBuilder.ParseHtml(TemplateParser parser) +130  
       Telerik.Cms.Web.UI.Templates.ObjectBuilder.ParseHtml(String html) +119  
       Telerik.Cms.Web.UI.Templates.ObjectBuilder..ctor(ObjectBuilder parent, String html) +71  
       Telerik.Cms.Web.UI.Templates.ObjectBuilder..ctor(ObjectBuilder parent, String html, ResourceManager resourceManager) +52  
       Telerik.Cms.Web.UI.Templates.ControlBuilder..ctor(ObjectBuilder parent, String html, ResourceManager resourceManager) +55  
       Telerik.Cms.Web.UI.Templates.RootBuilder..ctor(ResourceManager resourceManager, String html, ObjectBuilder parent) +55  
       Telerik.Cms.Web.UI.Templates.RootBuilder..ctor(ResourceManager resourceManager, String html) +54  
       Telerik.Framework.Web.StringTemplate..ctor(String declaration, ResourceManager resourceManager, String templateName) +75  
       Telerik.Framework.Web.ControlUtils.GetTemplate(String virtualPath, String resourceFileName, Type assemblyInfo, Type localizationAssemblyInfo) +1115  
       Telerik.Framework.Web.ControlUtils.GetTemplate(String virtualPath, String resourceFileName, Type assemblyInfo, Type localizationAssemblyInfo, Type templateMapType, String additionalTemplateKey) +602  
       Telerik.Cms.Web.UI.SimpleControl.CreateLayoutTemplate(Type assemblyInfo, Type localizationAssemblyInfo) +228  
       Telerik.Cms.Web.UI.SimpleControl.get_LayoutTemplate() +102  
       Telerik.Cms.Web.UI.SimpleControl.get_Container() +127  
       Telerik.Cms.Web.UI.SimpleControl.CreateChildControls() +84  
       System.Web.UI.Control.EnsureChildControls() +87  
       System.Web.UI.Control.PreRenderRecursiveInternal() +44  
       System.Web.UI.Control.PreRenderRecursiveInternal() +171  
       System.Web.UI.Control.PreRenderRecursiveInternal() +171  
       System.Web.UI.Control.PreRenderRecursiveInternal() +171  
       System.Web.UI.Control.PreRenderRecursiveInternal() +171  
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842  
     
       
     
     
    --------------------------------------------------------------------------------  
    Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.50727.3074  

    It is the LayoutTemplateName Property that is causing this error. If I comment it out it works like a champ, however with it commented out I get another error when I try and reference one of my controls in the Template.
    /// <summary>  
            /// Gets or sets the path to a custom layout template for the control.  
            /// </summary>  
            [WebSysTemplate(WeatherForecast.SettingsTemplateName  
                , "WeatherForecastControlDescription""/Sitefinity/"false"2009-03-15")]  
            public override string LayoutTemplatePath  
            {  
                get 
                {  
                    return base.LayoutTemplatePath;  
                }  
                set 
                {  
                    base.LayoutTemplatePath = value;  
                }  
            }  
     
            /// <summary>  
            /// Gets the name of the embedded layout template.  
            /// </summary>  
            public override string LayoutTemplateName  
            {  
                get 
                {  
                    return WeatherForecast.SettingsTemplateName;  
                }  
            }
    #region Constants  
            protected const string SettingsTemplateName = "GambitCreations.Sitefinity.WeatherModule.Resources.ControlTemplates.Public.WeatherForecast.ascx";  
            protected const string SettingsLocalizationFile = "GambitCreations.Sitefinity.WeatherModule.Resources.Messages.resx";
            #endregion 


    Thanks!
  2. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    27 Apr 2009
    Link to this post
    Hi Garry Clark,

    The problem might be in your embedded template file: GambitCreations.Sitefinity.WeatherModule.Resources.ControlTemplates.Public.WeatherForecast.ascx

    While you are using embedded templates or external templates with .sft extension, they are parsed with our internal template parser. Some of the declarations in the .ascx, which work fine with the ASP.NET template parser, may not work with ours.
    If you send us the template file, we could investigate it and tell you what is causing this error.

    Best wishes,
    Vlad
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
2 posts, 0 answered