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

Forums / General Discussions / Layout-like control

Layout-like control

12 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    05 May 2010
    Link to this post
    With SF4 and the new layouts...is it possible to create a usercontrol that when I drop it onto the designer I get 3 placeholders to then drop 3 other controls into?

    So then at render I can place those 3 content items however I want (tabstrip, jQuery, etc)?

    What I mean is, can the usercontrols embed layout controls and have SF pick that up when I plop it onto the page...

    (does that make sense?)

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 May 2010
    Link to this post
    Hi Steve,

    Thank you for using our services.

    In Sitefinity 4.0 we have two types of page controls - content controls and layout controls. You can create your own layout controls and add them to the layouts toolbox. Then you can drop this control on the page while in the Layout editing mode of the Page Editor. Then  in Content editing mode you can add controls in your layout. This is what is available currently in the new version, I am not sure however if this is exactly what you are looking for. You can check those two help articles for more information on how to create layouts:
    Layout Controls Overview
    Creating Layout Controls

    All the best,
    Radoslav Georgiev
    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.
  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    05 May 2010
    Link to this post
    The question was more about can i "embed" a layout control into a usercontrol such that when I drop it onto the page it gives me more content placeholders automatically...so I dont want a layout control itself, but want to leverage the ability to have that dynamic content placeholder functionality of the layout controls
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 May 2010
    Link to this post
    Hello Steve,

    Unfortunately the controls are not designed to work this way. You will have to first go to Layout - drop the layout control anywhere on the page and then go to content to put content in its placeholders.

    Best wishes,
    Radoslav Georgiev
    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.
  5. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    08 Nov 2010
    Link to this post
    Hi, I've created a custom layout control, followed the steps indicated in the article and also using the existing controls as basis, but I'm having this error by the time I drag the created layout control to the page. It pops up:

    Object reference not set to an instance of an object.
  6. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    08 Nov 2010
    Link to this post
    Please disregard my previous question. :)
  7. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    08 Nov 2010
    Link to this post
    However, I have a new error.

    Unable to cast object of type 'ASP.Summary_8' to type 'Telerik.Sitefinity.Web.UI.LayoutControl'.

  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    08 Nov 2010
    Link to this post
    Hello jkregala,

    What are the steps we can follow to replicate this error? It looks like that you use a custom Layout Controls. If so, what is the code you have?

    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
  9. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    08 Nov 2010
    Link to this post
    Basically steps 1-5 of this article: http://www.sitefinity.com/40/help/developer-manual/pages-layouts-creating-layout-controls.html

    And then I could already see the newly-added layout template among the existing ones. I added this newly added template into my page, saved it, exited the page, and when re-opened the page, boom.

    Here's my code for the ascx file:

    <%@ Control Language="C#" ClassName="Summary_8" %>
     
    <div runat="server" id="content">
        <div runat="server" class="group col1">
     
        </div>
        <div runat="server" class="group col2">
     
        </div>
        <div runat="server" class="group col3">
     
        </div>
        <div runat="server" class="group col4">
     
        </div>
        <div runat="server" class="group col5">
     
        </div>
        <div runat="server" class="group col6">
     
        </div>
        <div runat="server" class="group col7">
     
        </div>
        <div runat="server" class="group col8">
     
        </div>
    </div>

    Error with the ClassName?
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    08 Nov 2010
    Link to this post
    Hi jkregala,

    Please take a look at this post - Issue with adding Layout Controls

    Greetings,
    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
  11. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    10 Nov 2010
    Link to this post
    I don't see how that post is related to my error. Please help. Anyway on my .ascx file (which is the base file of my custom layout control) I tried to remove ClassName="Summary_8" but I'm having this error:

    Unable to cast object of type 'ASP.sitefinity_customcontrols_layoutcontrols_summary_8_ascx' to type 'Telerik.Sitefinity.Web.UI.LayoutControl'.


    Could I just have a sample .ascx file that I could base on so that I won't be having these problems anymore? I think you should update this article for BETA2 http://www.sitefinity.com/40/help/developer-manual/pages-layouts-creating-layout-controls.html if it's not working. I followed it word for word.
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    10 Nov 2010
    Link to this post
    Hi jkregala,

    The error you see is related to the other post  and I am not sure why do not use the sample code from there? You are getting a general cast exception - you cannot cast .ascx to type LayoutControl and my sample code in the other post clearly shows how to create a control that inherits from LayoutControl class. Furthermore there is a short video attached to the post that illustrates the behavior of the newly created LayoutControl. 

    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
12 posts, 0 answered