More in this section

Forums / Developing with Sitefinity / Control Template Properties?

Control Template Properties?

5 posts, 1 answered
  1. John Dentler
    John Dentler avatar
    12 posts
    Registered:
    23 Apr 2010
    10 May 2010
    Link to this post
    Hi Guys,

    When modifying control templates, is it possible to tap into an event property (eg. Event_Start )? My goal is to use a property more than once on a control template ascx file. The following is from Events\ContentViewSingleItemView.ascx

    There's auto-magic happening with the following tag to get Event_Start on the page:
    <telerik:DateTimeLiteral runat="server" ID="Event_Start" DateFormatString="D"></telerik:DateTimeLiteral>

    However, I can't put two of these on the page with the same ID, of course. Is it possible to use something like the following to tap into properties?
    <asp:Literal ID="Event_Start_Time" runat="server" Text='<%= Event_Start %>'/>

    Also, is there a configuration file or something that shows what fields can be used on the web control? (eg. City, State, Event_Start)

    Thanks, and keep up the great work!

    John D

    <%@ Control Language="C#" %>
    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls"
     TagPrefix="sfWeb" %>
    <%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Web.UI.SpamProtection"
     TagPrefix="sfWeb" %>
    <telerik:CssFileLink ID="CssFileLink1" EmbeddedFileName="Telerik.Events.Resources.ControlTemplates.Frontend.eventsCommonLayout.css"
     FileName="" Media="screen" runat="server" />

    <h3>
     <asp:Literal ID="Title" runat="server" />
    </h3>
    <p>
     &nbsp;
    </p>
    <b>Date:</b>
    <telerik:DateTimeLiteral runat="server" ID="Event_Start" DateFormatString="D"></telerik:DateTimeLiteral>
    <br />
    <b>Time:</b>
    <asp:Literal ID="Event_Start_Time" runat="server" Text='<%= Event_Start %>'/>
    -
    <asp:Literal ID="Event_End_Time" runat="server" Text='<%= Event_End %>'/><br />



     

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    10 May 2010
    Link to this post
    Hello John Dentler,

    Try using MetaMaster Method described here

    Sincerely yours,
    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.
    Answered
  3. John Dentler
    John Dentler avatar
    12 posts
    Registered:
    23 Apr 2010
    10 May 2010
    Link to this post
    Thanks for the quick reply, Ivan. I'll have a look and report back.

    JD
  4. John Dentler
    John Dentler avatar
    12 posts
    Registered:
    23 Apr 2010
    10 May 2010
    Link to this post
    Works like a charm so far. Thanks again!
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    10 May 2010
    Link to this post
    Hi John Dentler,

    Always glad to help. You can mark the reply as answer, so it could help if someone has the same problem.

    Sincerely yours,
    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.
Register for webinar
5 posts, 1 answered