Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hello there,
I just wanted to share this solution as there were many elements that were very tricky.
This requirements were for a plugin in Action Winwod which would enable users with Administration rights to Publish or move pages to the Recycling bin from a PageList with Pagination.
ASCX
<%@ Control Language="c#" CodeBehind="ManageComments.ascx.cs" AutoEventWireup="true"
Inherits="MyProject.Templates.Admin.ManageComments" %>
<%@ Import Namespace="EPiServer" %>
<%@ Import Namespace="EPiServer.Core" %>
<%@ Register TagPrefix="MyProject" Namespace="MyProject.Extension" Assembly="MyProject" %>
<h1>
Comments</h1>
<asp:Literal ID="MessageLiteral" Visible="false" runat="server">This plugin is only available to users that belong to the Administrators group.</asp:Literal>
<asp:Panel ID="ControlPanel" Visible="false" runat="server">
<MyProject:LanguageDropDownList ID="ddSelectLanguage" runat="server" EnableViewState="true"
OnSelectedIndexChanged="ddSelectLanguage_OnSelectedIndexChanged" />
<br />
<div style="padding-bottom: 3px">
</div>
<EPiServer:PageList ID="CommentsList" runat="server" PublishedStatus="Ignore" PagesPerPagingItem="10" Paging="true">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<div style="float: left; border: 1px; border-style: solid; padding: 10px; display: block;
width: 100%">
<div style="float: left; width: 85%;">
<dl style="float: left;">
<dt style="float: left; clear: left; width: 15%; margin-right: 10px;">User name</dt>
<dd style="float: left; width: 80%; margin-left: 0;">
<%# GetLastVersion(((PageData)Container.DataItem).PageLink).Property["UserName"] %>
</dd>
<dt style="float: left; clear: left; width: 15%; margin-right: 10px;">Date:</dt>
<dd style="float: left; width: 80%; margin-left: 0;">
<%# GetLastVersion(((PageData)Container.DataItem).PageLink).Property["PageStartPublish"]%>
</dd>
<dt style="float: left; clear: left; width: 15%; margin-right: 10px;">URL:</dt>
<dd style="float: left; width: 80%; margin-left: 0;">
<a href="<%# ((PageData)Container.DataItem).LinkURL %>" target="PreviewFrame">
<%# ((PageData)Container.DataItem).LinkURL %></a></dd>
<dt style="float: left; clear: left; width: 15%; margin-right: 10px;">Comment:</dt>
<dd style="float: left; width: 80%; margin-left: 0;">
<%# GetLastVersion(((PageData)Container.DataItem).PageLink).Property["Comment"]%>
</dd>
</dl>
</div>
<div style="float: right; width: 15%;">
<%# GetStatus(((PageData)Container.DataItem))%>
<asp:Button ID="ApproveButton" runat="server" Text="Approve" OnClick="ApproveButton_OnClick"
CommandArgument="<%# ((PageData)Container.DataItem).PageLink.ID %>" Visible='<%# ((PageData)Container.DataItem).Property["PagePendingPublish"].ToString() == string.Empty? false: true %>' />
<br />
<asp:Button ID="RejectButton" runat="server" Text="Reject" OnClick="RejectButton_OnClick"
CommandArgument="<%# ((PageData)Container.DataItem).PageLink.ID %>" Visible='<%# ((PageData)Container.DataItem).Property["PagePendingPublish"].ToString() == string.Empty? false: true %>' />
</div>
</div>
<div style="padding-bottom: 1px">
</div>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
<PagingHeaderTemplate>
<div style="float: left; border: 1px; border-style: solid; padding: 10px; display: block;
width: 100%; background-color: LightGray">
<div style="float: left; width: 30%;">
</PagingHeaderTemplate>
<PagingFooterTemplate>
</div>
<div style="float: left; width: 70%;">
<%# GetPagingText(CommentsList.PagingControl.CurrentPagingItemIndex, ((PageDataCollection)CommentsList.DataSource).Count)%>
</div>
</div>
</PagingFooterTemplate>
</EPiServer:PageList>
</asp:Panel>
ASCX.CS