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

Forums / Developing with Sitefinity / ProductsPublicView

ProductsPublicView

31 posts, 1 answered
  1. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    20 Jul 2009
    Link to this post
    I would like to change this view (taken from the products sample module).
    I have been able to make changes to the ProductPreviewView.cs and it's template file.
    But the publicview.cs file does not have a template file. (in the sample)

    Could you give any guidence on how i would attach such a tempale to this cs file? And generally how do make those changes?

    Thanks.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    20 Jul 2009
    Link to this post
    Hello Andrew,

    1. You need to create a control designer

    Sample code:

    namespace Telerik.Samples.Products.WebControls.Admin.Products 
        public class CustomDesigner : ContentViewDesignerBase 
        { 
            public override string  DesignerTemplateName 
            { 
                get  
                {  
                    return CustomDesigner.layoutTemplateName; 
                } 
            } 
     
            private const string layoutTemplateName = "Telerik.Samples.Products.Resources.ControlTemplates.Backend.CustomControlDesigner.ascx"
        } 

    2. Create the template for your designer CustomControlDesigner.ascx
    3. Set the ControlDesigner for ProductsPublicView class as below:

    [Telerik.Framework.Web.Design.ControlDesigner("Telerik.Samples.Products.WebControls.Admin.Products.CustomDesigner")] 
        public class ProductsPublicView : ContentView 


    Sincerely yours,
    Ivan Dimitrov
    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.
  3. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    20 Jul 2009
    Link to this post
    Hi Ivan,

    I tried this and am getting an error:

    "Invalid resaurce name(Telerik.Cms.Engine.Resources.ControlTemplates.Frontend.ContentViewItemList.ascx)

    This is the code in my ProductsPulbicView.cs (or BarkersPublicView in my case)

    using System;  
     
    using Telerik.Cms.Engine.WebControls;  
     
    using Telerik.Cms.Engine.WebControls.Design;  
     
    using Telerik.Framework.Web.Design;  
     
    namespace Cint.Cms.Barkers.WebControls  
     
    {  
     
    /// <summary>  
     
    /// Public control for displaying barkers  
     
    /// </summary>  
     
    [Telerik.Framework.Web.Design.ControlDesigner("Cint.Cms.Barkers.WebControls.CustomDesigner")]  
     
    public class BarkersPublicView : ContentView  
     
    {  
     
     
    }  
     
     
    public class CustomDesigner : ContentViewDesignerBase  
     
    {  
     
    public override string DesignerTemplateName  
     
    {  
     
    get 
     
    {  
     
    return CustomDesigner.layoutTemplateName;  
     
    }  
     
    }  
     
    private const string layoutTemplateName = "Cint.Cms.Barkers.Resources.ControlTemplates.Frontend.BarkersPublicView.ascx";  
     
    }   
     
    }  
     
     


    My template is empty right now.

     

    <%@ Control Language="C#" %> 
    Test 


    Do you know what i am missing?

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    21 Jul 2009
    Link to this post
    Hi Andrew,

    1. Create a new separate class for CustomDesigner

    2. In BarkersPublicView override the properties below:

      public override Type LocalizationAssemblyInfo 
            { 
                get 
                { 
                    return this.GetType(); 
                } 
                set 
                { 
                    base.LocalizationAssemblyInfo = value; 
                } 
     
            public override Type AssemblyInfo 
            { 
                get 
                { 
                    return this.GetType(); 
                } 
                set 
                { 
                    base.AssemblyInfo = value; 
                } 
            } 


    All the best,
    Ivan Dimitrov
    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.
  5. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    21 Jul 2009
    Link to this post
    Still getting this error:

    Invalid resource name (Telerik.Cms.Engine.Resources.ControlTemplates.Frontend.ContentViewItemList.ascx) for assembly (Cint.Cms.Barkers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) or empty template.

    If i change the code you provided
    return this.GetType(); 

    To:

    return

     

    typeof(ContentView);

     


    Which was in the barkerpublicview before i strted making the changes, instead of the error i get a blank screen.
    If i then press the edit button, i get this error:

    A required control was not found in the template for "Cint.Cms.Barkers.Resources.ControlTemplates.Frontend.BarkersPublicView.ascx". The control must be assignable form type "System.Web.UI.WebControls.HiddenField" and must have ID "designerIsDirty".

    Also, why is it looking for Telerik.Cms.Engine.Resources.ControlTemplates.Frontend.ContentViewItemList.ascx, no such control exists in my code.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    21 Jul 2009
    Link to this post
    Hi Andrew,

    The Control Designer requires that you should have the lines below in your template

    <asp:HiddenField ID="selectedModeIdField" runat="server" /> 
    <asp:HiddenField ID="selectedModeClientIdField" runat="server" /> 
    <asp:HiddenField ID="designerIsDirty" runat="server" /> 
     

    The control below are also required since we are inheriting from ControlDesigner.
    type PresentationModes, ID= "presentationModes"

    For instance you can download and observer BlogPostsControlDesigner.ascx which also inherits from ControlDesigner.


    All the best,
    Ivan Dimitrov
    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.
  7. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    21 Jul 2009
    Link to this post
    Hi Ivan,

    I have it finally working. But now that i have, i reliase this is not what i am looking for.
    I must have not been clear about it. But i am looking to change the frontend. Not the backend options.

    I want to make a template for the end user, what they will see. With this, they see an empty screen.
    There is nothing on the live site.

    I have now tried to add this:

     

    public override string ItemListTemplateName  
            {  
                get 
                {  
                    return BarkersPublicView.itemTemplateName;  
                }  
            }  
     
            public override string SingleItemTemplateName  
            {  
                get 
                {  
                    return BarkersPublicView.itemTemplateName;  
                }  
            }  
     
            private const string itemTemplateName =  
                "Cint.Cms.Barkers.Resources.ControlTemplates.Frontend.BarkersPublicView.ascx"


    But am getting this error:

    Invalid resource name (Cint.Cms.Barkers.Resources.ControlTemplates.Frontend.BarkersPublicView.ascx) for assembly (Telerik.Cms.Engine, Version=3.6.1936.2, Culture=neutral, PublicKeyToken=dfeaee0e3978ac79) or empty template.


    What am i missing here?

  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    21 Jul 2009
    Link to this post
    Hello Andrew,

    The namespace is not correct, you do not have a template or your template is not built as embedded.

    All the best,
    Ivan Dimitrov
    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.
  9. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    21 Jul 2009
    Link to this post
    So , the code is correct and it's a problem with the template?

    I have created a new file called BarkersPublicView.ascx
    In a project called:

    Cint.Cms.Barkers

     

    In folder:
    Resources.ControlTemplates.Frontend
    Hence:
    "Cint.Cms.Barkers.Resources.ControlTemplates.Frontend.BarkersPublicView.ascx"

    The template file is almost empty:
    It only has the following:

     

     

     

     

    <%@ Control Language="C#" %> 
     
    test  
     

     

    Is there a template in the system i could use as a sample?

     

     

  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    21 Jul 2009
    Link to this post
    Hi Andrew,

    "For instance you can download and observer BlogPostsControlDesigner.ascx which also inherits from ControlDesigner."

    Kind regards,
    Ivan Dimitrov
    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.
  11. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    21 Jul 2009
    Link to this post
    As i have stated above, I have done so and all the code in the control is related to the options one sees when one clicks the edit button in the admin section of the system.

    What i am looking for is NOT the admin section. But rather the CLIENT FRONT END part of the system.
    More presisely the template that the end user would see.

    A
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    21 Jul 2009
    Link to this post
    Hello Andrew,

    Let me briefly describe you some of the building parts and how they works, because I see some misunderstanding in the logic.

    What i am looking for is NOT the admin section. But rather the CLIENT FRONT END part of the system.
    More presisely the template that the end user would see.


    1. ContentView controls designer collects data for the front end templates.

    First the sample module does not have control designer. I sent you several examples how to implement it.

    2. Once you have a Control Designer you should add your templates and use them as embedded. Without having a designer you cannot set your public templates . Let's call the templates ListPageMaster and ListPageDetails.
    A good example is BlogPostsControlDesigner and its presentation modes. As you can see in this designer we set the namespace to our embedded templates.

       <sf:PresentationMode ID="listPageMode" runat="server"  
                                                   ModeTitle="List &amp; page"  
                                                   ModeSettingsId="ModesSettings1"  
                                                   MasterTemplateName="Telerik.Blogs.Resources.ControlTemplates.Frontend.Modes.ListPageMaster.ascx" 
                                                   DetailTemplateName="Telerik.Blogs.Resources.ControlTemplates.Frontend.Modes.ListPageDetail.ascx" 
                                                   CssClass="pageListMode" 
                                                   SelectedCssClass="selectedOption pageListMode" 
                                                   > 

    All templates(BlogPostsControlDesigner, ListPageMaster, ListPageDetails) can be downloaded from your client account >> downloads section. Additionally you can observe Control Designer, Master and Details templates for News, Events etc.

    If you need further assistance or we have missed something, write back to us.

    Kind regards,
    Ivan Dimitrov
    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.
  13. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    22 Jul 2009
    Link to this post

    Hi Ivan

    I am getting to understand this a little bit better.

    Here is my ControlDesigner:

     

     

     

    <%@ Control Language="C#" %> 
    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls.Design" 
        TagPrefix="sf" %> 
    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls.Design.Settings" 
        TagPrefix="sf" %> 
    <div class="ctrlProps">  
        <div class="ctrlContent slidingWizard">  
            <div id="slidingWizardSteps">  
                <div id="Panel1">  
                    <h3> 
                        <asp:Literal ID="Literal2" runat="server" Text="Layout" /></h3>  
                    <div id="itemsDisplayOptions" class="contentViewDisplayOptions">  
                        <ul> 
                            <sf:PresentationModes ID="presentationModes" runat="server">  
                                <sf:PresentationMode ID="onePerPageMode" runat="server" ModeTitle="Rotator" 
                                    ModeSettingsId="ModesSettings1" MasterTemplateName="Cint.Cms.Barkers.Resources.ControlTemplates.Frontend.BarkerPublicView.ascx" 
                                    CssClass="onePerPageMode" SelectedCssClass="selectedOption onePerPageMode">  
                                    <Template> 
                                        <asp:RadioButton ID="onePerPageModeRadio" runat="server" /> 
                                    </Template> 
                                </sf:PresentationMode> 
                            </sf:PresentationModes> 
                        </ul> 
                    </div> 
                </div> 
                <div id="Panel2">  
                    <h3> 
                        Settings</h3> 
                    <div id="optionalSelectedMode">  
                        <sf:PresentationModeSettings ID="ModesSettings1" runat="server">  
                            <DetailSettings> 
                                <sf:TextSetting ID="setting1" TargetID="fullContent1" SettingTitle="Title" AllowLabelSetting="False" 
                                    AllowFormatSetting="False" AllowVisibilitySetting="False" TargetVisibleByDefault="True">  
                                </sf:TextSetting> 
                            </DetailSettings> 
                        </sf:PresentationModeSettings> 
                    </div> 
                </div> 
            </div> 
        </div> 
    </div> 
    <asp:HiddenField ID="selectedModeIdField" runat="server" /> 
    <asp:HiddenField ID="selectedModeClientIdField" runat="server" /> 
    <asp:HiddenField ID="designerIsDirty" runat="server" /> 

     



    I am unfortunetely still getting an error. As soon as i select the layout. This error apears:

    "Invalid resource name (Cint.Cms.Barkers.Resources.ControlTemplates.Frontend.BarkerPublicView.ascx) for assembly (Telerik.Cms.Engine, Version=3.6.1936.2, Culture=neutral, PublicKeyToken=dfeaee0e3978ac79) or empty template"

  14. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    22 Jul 2009
    Link to this post
    Hi Andrew,

    Have you set the template as embedded. It seems that it could not be found. This is what the error says.

    All the best,
    Ivan Dimitrov
    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.
  15. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    22 Jul 2009
    Link to this post
    I have set the BuildActiom to Embedded Recaurce in the template porperties.
    Is that what you mean? Or is there another place i need to do it?

    A
  16. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    22 Jul 2009
    Link to this post
    Hello Andrew,

    Yes, this is what I was talking about. If the problem persists, send us a screenshot of the error you are getting,  the code of BarkerPublicView.cs and ControlDesigner.cs

    Sincerely yours,
    Ivan Dimitrov
    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.
  17. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    23 Jul 2009
    Link to this post
    Ivan,

    I have opened a support ticket and posted my code and the error there. (229691)

    Thanks.

    A
  18. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    23 Jul 2009
    Link to this post
    Hello Andrew,

    I will take care of this and get back in the ticket.

    All the best,
    Ivan Dimitrov
    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.
    Answered
  19. Adam
    Adam avatar
    33 posts
    Registered:
    23 Feb 2009
    21 Feb 2010
    Link to this post
    Hi Ivan,

    Any update on this? I'm also trying to embed a template to the public view (from the products module and getting the same "invalid resource..." error.

    thanks!
  20. Adam
    Adam avatar
    33 posts
    Registered:
    23 Feb 2009
    21 Feb 2010
    Link to this post
    Nevermind! I got it to work by retracing the steps.

    Thanks again!
  21. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    21 Feb 2010
    Link to this post
    Hello Adam,

    The problem has been escalated to support request and resolved there, so this is why there is not update on this in the forum. Andrew has made some mistakes in this code, but it seems that you have managed to fix them by yourself.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  22. sam
    sam avatar
    102 posts
    Registered:
    31 Jan 2008
    31 Mar 2010
    Link to this post
    I too am getting :

    Invalid resource name (Telerik.Cms.Engine.Resources.ControlTemplates.Frontend.ContentViewItemList.ascx) for assembly (Telerik.Samples.Products, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) or empty template.



    Using the example you made available for download. Is there a fix or file missing?
  23. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    31 Mar 2010
    Link to this post
    Hi sam,

    As you can see the control is trying to load the default embedded template -Telerik.Cms.Engine.Resources.ControlTemplates.Frontend.ContentViewItemList.ascx

    You could modify your code as shown below

    amespace Telerik.Samples.Products.WebControls
    {
        /// <summary>
        /// Public control for displaying products
        /// </summary>
        public class ProductsPublicView : ContentView
        {
            /// <summary>
            /// Gets the type from the assembly containing the embedded localization resource.
            /// Override if embedded templates are using ASP.NET localization.
            /// </summary>
            /// <value></value>
            public override Type LocalizationAssemblyInfo
            {
                get
                {
                    return this.GetType();
                }
                set
                {
                    base.LocalizationAssemblyInfo = value;
                }
            }
     
            /// <summary>
            /// Gets the type from the assembly containing the embedded resources.
            /// Cannot be null reference.
            /// </summary>
            /// <value></value>
            public override Type AssemblyInfo
            {
                get
                {
                    return this.GetType();
                }
                set
                {
                    base.AssemblyInfo = value;
                }
            }
     
            [WebSysTemplate(ProductsPublicView.ProductsViewItemListTemplateName, "ProductsViewItemListTemplateName_Desc", "/Products", true, "2009-02-17")]
            public override string ItemListTemplatePath
            {
                get
                {
                    return base.ItemListTemplatePath;
                }
                set
                {
                    base.ItemListTemplatePath = value;
                }
            }
     
            public override string ItemListTemplateName
            {
                get
                {
                    if (string.IsNullOrEmpty(this.itemListTemplateName))
                        this.itemListTemplateName = ProductsPublicView.ProductsViewItemListTemplateName;
                    return this.itemListTemplateName;
                }
                set
                {
                    this.itemListTemplateName = value;
                }
            }
     
            [WebSysTemplate(ProductsPublicView.ProductsViewSingleItemTemplateName, "ProductsViewSingleItemTemplateName_Desc", "/Products", true, "2009-02-17")]
            public override string SingleItemTemplatePath
            {
                get
                {
                    return base.SingleItemTemplatePath;
                }
                set
                {
                    base.SingleItemTemplatePath = value;
                }
            }
     
            public override string SingleItemTemplateName
            {
                get
                {
                    if (string.IsNullOrEmpty(this.singleItemListTemplatePath))
                        this.singleItemListTemplatePath = ProductsPublicView.ProductsViewSingleItemTemplateName;
                    return this.singleItemListTemplatePath;
                }
                set
                {
                    this.singleItemListTemplatePath = value;
                }
            }
     
     
            /// <summary>
            /// If this property is empty the control will try to detect if a provider is specified in the request or it will use the default provider.
            /// </summary>
            /// <value></value>
            public override string ProviderName
            {
                get
                {
                    object obj = ViewState["ProviderName"];
                    if(obj != null)
                        return (string) obj;
                    return ProductsManager.DefaultContentProvider;
                }
                set
                {
     
                   this.ViewState["ProviderName"] = value;
                }
            }
       
            #region Constants
     
            private const string ProductsViewItemListTemplateName =
                "Telerik.Samples.Products.Resources.ControlTemplates.Frontend.Modes.ListPageMaster.ascx";
     
            private const string ProductsViewSingleItemTemplateName =
               "Telerik.Samples.Products.Resources.ControlTemplates.Frontend.Modes.ListPageDetail.ascx";
     
     
            #endregion
            //private ProductsManager manager;
     
            private string itemListTemplateName;
            private string singleItemListTemplatePath;
        }
    }

    You can use ContentViewItemList and ContentViewSingleItem templates instead ListPageMaster and ListPageDetails. You can download the templates from downloads section of your account. There a zip file called ExternalTemplates.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  24. sam
    sam avatar
    102 posts
    Registered:
    31 Jan 2008
    01 Apr 2010
    Link to this post
    Hi Ivan,

    This is confusing..

    I have tried adding the code to the Telerik.Samples.Products project, but it is not building..

    dont't know namespace for: WebSysTemplate or "Type LocalizationAssemblyInfo"


    I just want to use the files provided in the sample:

    ContentViewItemList.ascx
    ContentViewSingleItem.ascx

    What do I have to do to get it to use them??

    Why are they in the sample you provided if they don't work...????

    Invalid resource name (Telerik.Cms.Engine.Resources.ControlTemplates.Frontend.ContentViewItemList.ascx) for assembly (Telerik.Samples.Products, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) or empty template.

  25. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    01 Apr 2010
    Link to this post
    Hi sam,

    You could take a look at this post - Overriding the LayoutTemplatePath and WebSysTemplate attribute. The modules are samples and not all parts are completed.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  26. Senthil Kumar
    Senthil Kumar avatar
    3 posts
    Registered:
    05 May 2010
    06 May 2010
    Link to this post
    I get the Exact Same error as below

    Invalid resource name (Telerik.Cms.Engine.Resources.ControlTemplates.Frontend.ContentViewItemList.ascx) for assembly (Telerik.Samples.Products, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) or empty template.


    I Use Sitefinity Standard Edition 3 .7 SP3. I dont find the Code for the class ProductsPublicView. I want to make the Products Module working to proceed further. Please help me
  27. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    06 May 2010
    Link to this post
    Hello Senthil Kumar,

    Have you tried the suggestion from the previous post? Currently the control you have is looking for the template of the base class which could not be found. You need to create custom template and override LayoutTemplatePath and LayoutTemplateName properties as suggested in the article.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  28. Senthil Kumar
    Senthil Kumar avatar
    3 posts
    Registered:
    05 May 2010
    06 May 2010
    Link to this post
    Thanks Ivan,

    I did gone through the previous post, but I am unsure where should I add this class etc. Can you explain me little more in details of how do I get this solved. Also If you can give me link to a Document that will help me to develop a module step by step, It should help me a lot

    Thanks & Regards
    Senthil
  29. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    07 May 2010
    Link to this post
    Hello Senthil Kumar,

    Below you can find a sample implementation of ProductsPublicView

    using Telerik.Samples.Products.Resources;
    using Telerik.Web;
     
    namespace Telerik.Samples.Products.WebControls
    {
        /// <summary>
        /// Represents a toolbox item for NewsArchive control.
        /// </summary>
        public class ProductsViewToolboxItem : ToolboxItem
        {
            /// <summary>
            /// Constructs a new instance of ProductsViewToolboxItem class and sets DisplayName and Description
            /// properties for the NewsArchive control.
            /// </summary>
            public ProductsViewToolboxItem()
                : base(typeof(ProductsPublicView))
            {
                base.DisplayName = Messages.ProductsPublicView_DisplayName;
                base.Description = Messages.ProductsPublicView_Description;
            }
        }
    }

    using System;
    using System.Web.UI;
    using Telerik.Cms.Engine.WebControls;
    using Telerik.Cms.Web.UI;
    using Telerik.Samples.Products.Resources;
    using Telerik.Web.UI;
    using Telerik.Cms.Engine;
    using System.Collections;
    using Telerik.Framework.Web;
    using System.Web.UI.WebControls;
    using System.ComponentModel;
    using Telerik.Cms.Engine.ContentViewFiltering;
     
    namespace Telerik.Samples.Products.WebControls
    {
         
        public class ProductsPublicView : ContentView
        {
            /// <summary>
            /// Gets the type from the assembly containing the embedded localization resource.
            /// Override if embedded templates are using ASP.NET localization.
            /// </summary>
            /// <value></value>
            public override Type LocalizationAssemblyInfo
            {
                get
                {
                    return this.GetType();
                }
                set
                {
                    base.LocalizationAssemblyInfo = value;
                }
            }
     
            /// <summary>
            /// Gets the type from the assembly containing the embedded resources.
            /// Cannot be null reference.
            /// </summary>
            /// <value></value>
            public override Type AssemblyInfo
            {
                get
                {
                    return this.GetType();
                }
                set
                {
                    base.AssemblyInfo = value;
                }
            }
     
     
            [WebSysTemplate(ProductsPublicView.ProductsViewItemListTemplateName, "ProductsViewItemListTemplateName_Desc", "/Products", true, "2009-02-17")]
            public override string ItemListTemplatePath
            {
                get
                {
                    return base.ItemListTemplatePath;
                }
                set
                {
                    base.ItemListTemplatePath = value;
                }
            }
     
            public override string ItemListTemplateName
            {
                get
                {
                    if (string.IsNullOrEmpty(this.itemListTemplateName))
                        this.itemListTemplateName = ProductsPublicView.ProductsViewItemListTemplateName;
                    return this.itemListTemplateName;
                }
                set
                {
                    this.itemListTemplateName = value;
                }
            }
     
            [WebSysTemplate(ProductsPublicView.ProductsViewSingleItemTemplateName, "ProductsViewSingleItemTemplateName_Desc", "/Products", true, "2009-02-17")]
            public override string SingleItemTemplatePath
            {
                get
                {
                    return base.SingleItemTemplatePath;
                }
                set
                {
                    base.SingleItemTemplatePath = value;
                }
            }
     
            public override string SingleItemTemplateName
            {
                get
                {
                    if (string.IsNullOrEmpty(this.singleItemListTemplatePath))
                        this.singleItemListTemplatePath = ProductsPublicView.ProductsViewSingleItemTemplateName;
                    return this.singleItemListTemplatePath;
                }
                set
                {
                    this.singleItemListTemplatePath = value;
                }
            }
     
     
            /// <summary>
            /// If this property is empty the control will try to detect if a provider is specified in the request or it will use the default provider.
            /// </summary>
            /// <value></value>
            public override string ProviderName
            {
                get
                {
                    object obj = ViewState["ProviderName"];
                    if(obj != null)
                        return (string) obj;
                    return ProductsManager.DefaultContentProvider;
                }
                set
                {
     
                   this.ViewState["ProviderName"] = value;
                }
            }
         
     
            
            #region Constants
     
            private const string ProductsViewItemListTemplateName =
                "Telerik.Samples.Products.Resources.ControlTemplates.Frontend.Modes.ListPageMaster.ascx";
     
    private const string ProductsViewSingleItemTemplateName =
             "Telerik.Samples.Products.Resources.ControlTemplates.Frontend.Modes.ListPageDetail.ascx";
     
     
            #endregion
            private string itemListTemplateName;
            private string singleItemListTemplatePath;
        }
    }


    For more information about implementing custom modules you could take a look at Sitefinity 3.6 new backend architecture - documentation outline

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  30. Senthil Kumar
    Senthil Kumar avatar
    3 posts
    Registered:
    05 May 2010
    07 May 2010
    Link to this post
    Thanks Ivan,

    Your code helped me, My case the class was named as ProductsView & later I didnt marked the ascx files as Embedded Resource. Correcting above errors solved my issue.

    Now I have the next question, I dont want the controls to be embedded in the DLL, I want them to be placed in Folders like all other User Controls. How do I achive this.

    Thanks & Regards
    Senthil
Register for webinar
31 posts, 1 answered
1 2