Try Now
More in this section

Forums / General Discussions / Extending the EventsView control

Extending the EventsView control

1 posts, 0 answered
  1. Sharon
    Sharon avatar
    39 posts
    14 Jun 2011
    09 Jul 2013
    Link to this post
    I am building a page for displaying upcoming and previously recorded webinars. The design calls for a drop-down list for our products at the top along with checkboxes for upcoming or recorded. I am supposed to use these to filter the webinars that are displayed.

    I am having trouble with the filtering part.I started with Events. I have added custom fields for the Product associated with the webinar and the recording URL. A previous contractor had already added a custom field for the registration. I'm using the category to choose between upcoming webinars and recorded ones.

    I updated \Sitefinity\Admin\ControlTemplates\Events\EventsItemEdit and EventsItemNew for the back end. I updated \Sitefinity\Admin\ControlTemplates\Events\Modes\ExpandableListMaster for the table display.

    Now I'm at the filtering part. I was thinking I could make a new control of my own that referenced the EventsView Control and then I can just update the FilterExpression property on Page_Load of my control based on what they chose for a product/ type.

    If my class is based on System.Web.UI.UserControl, I get the error:
    A required control was not found in the template for "". The control must be assignable form type "System.Web.UI.WebControls.Repeater" and must have ID "PageRepeaterHyperLink".

    If my class is based on Telerik.Events.WebControls.EventsView, I get the error
    error ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or User Control).

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Webinars.ascx.cs" Inherits="custom_Webinars" %>
    <%@ Register TagPrefix="sfEvents" Namespace="Telerik.Events.WebControls" Assembly="Telerik.Events" %><asp:Table ID="tblSearch" runat="server" CssClass="searchtable">
                <asp:Label ID="lblSearch" runat="server" Text="Use the criteria below to search webinars:" CssClass="searchheader"></asp:Label>
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                            <label class="searchsubhead">Product:</label>                      
                            <label class="searchsubhead">Type:</label>
                            <asp:DropDownList ID="ddProduct" runat="server" AutoPostBack="True">
                                        <asp:ListItem Text="Choose a Product" Value=""></asp:ListItem>
                                        <asp:ListItem Text="SharePoint"></asp:ListItem>
                                        <asp:ListItem Text="Exchange"></asp:ListItem>
                            <asp:CheckBoxList ID="cblType" runat="server" AutoPostBack="True" CssClass="typecheckbox">
                                <asp:ListItem Value="Upcoming">Upcoming</asp:ListItem>
                                <asp:ListItem Value="Recorded">Recorded</asp:ListItem>
                Ad goes here
    </asp:Table><sfEvents:EventsView ID="sfEventsView" runat="server" ProviderName="Events" BehaviorMode="Auto"></sfEvents:EventsView>

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Telerik.Cms.Engine;
    using System.Collections;
    [Telerik.Web.UrlRewriterService("Telerik.Cms.Engine.ContentUrlRewriterService, Telerik.Cms.Engine")]
    public partial class custom_Webinars : Telerik.Events.WebControls.EventsView
        protected void Page_Load(object sender, EventArgs e)
            // set up filter based on choices

    What do I need to do to make this work?
1 posts, 0 answered