Authorlist-Widget not showing data

Topics: Controls
Mar 1, 2012 at 5:55 AM

I created an Authorlist-widget consistiong of the following files:

1) widget.ascx:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="widget.ascx.cs" Inherits="Widgets.AuthorList.Widget" %>
<blog:AuthorList ID="AuthorList1" runat="Server" />


2) widget.ascx.cs:
// --------------------------------------------------------------------------------------------------------------------
// <summary>
// The widget.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Widgets.AuthorList
{
using App_Code.Controls;

/// <summary>
/// The widget.
/// </summary>
public partial class Widget : WidgetBase
{
#region Properties

/// <summary>
/// Gets a value indicating whether the Widget is editable.
/// </summary>
public override bool IsEditable
{
get { return false; }
}

/// <summary>
/// Gets the Widget name.
/// </summary>
public override string Name
{
get { return "AuthorList"; }
}

#endregion

#region Public Methods

/// <summary>
/// This method works as a substitute for Page_Load. You should use this method for
/// data binding etc. instead of Page_Load.
/// </summary>
public override void LoadWidget()
{
// nothing to load
}

#endregion
}
}

However, when adding the widget to the page, it appears but the list of authors is just empty (it wasnt before upgrading to 2.5 from 2.0).

Any ideas?

Coordinator
Mar 1, 2012 at 9:35 PM
Edited Mar 2, 2012 at 4:37 AM

Not sure what you doing wrong, but i can definitely add a new widget, say "MyList", with author list control showing authors just fine.

To be precise, this works for me:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="widget.ascx.cs" Inherits="Widgets.MyList.Widget" %>
<blog:AuthorList ID="AuthorList1" runat="Server" />

namespace Widgets.MyList
{
    using App_Code.Controls;

    public partial class Widget : WidgetBase
    {
        public override bool IsEditable
        {
            get { return false; }
        }

        public override string Name
        {
            get { return "MyList"; }
        }

        public override void LoadWidget()
        {
            // nothing to load
        }
    }
}