Paging in Newslist.....

 

Hi, i have implemented paging in Newslist control (using Episerver CMS 5 R2). In addition to the newslist control, am having an XHTML text in the same aspx page, which should be displayed only in the first page of Newslist control.  When i move to others pages of the Newslist this XHTML text should not be displayed. How could i do this.....

-Nisha

 

 

#26043
Nov 18, 2008 15:02
Tore Gjerdrum
Member since: 2006
 

Hi Nishath.

Do you mean that you don`t want to show the XHTML property when you change the paging index in the paging control? What about having an asp:placeholder around the XHTML text and only showing it if the CurrentPagingItemIndex is 0? Haven`t tried it out though....

Br,

Tore 

#26044
Nov 18, 2008 15:12
 
Yes, i tried the same by checking CurrentPagingItemIndex, also then its getting displayed...
#26053
Nov 19, 2008 5:14
Tore Gjerdrum
Member since: 2006
 

Hi Nishath.

How are you doing it? Tried it out this morning and it worked fine.

Here is my aspx:

<EPiServer:NewsList runat="server" Paging="true" PageLinkProperty="NewsRoot" ID="plNewsList" PagesPerPagingItem="2">
  <HeaderTemplate>
     <h1><%#plNewsList.PagingControl.CurrentPagingItemIndex %></h1>
  </HeaderTemplate>
  <NewsTemplate>
     <EPiServer:Property runat="server" PropertyName="PageLink" />
     <br />
  </NewsTemplate>
  <PagingHeaderTemplate>
     <div>
  </PagingHeaderTemplate>
  <PagingFooterTemplate>
     </div>
  </PagingFooterTemplate>
</EPiServer:NewsList>
   
<asp:PlaceHolder runat="server" Visible="false" ID="plhBody">
     <Episerver:Property runat="server" PropertyName="MainBody" />
</asp:PlaceHolder>

Here is my codebehind:

 protected override void OnPreRender(System.EventArgs e)
 {
     base.OnPreRender(e);

    plhBody.Visible = plNewsList.PagingControl.CurrentPagingItemIndex == 0;
 }

Hope this helps!

BR, Tore

#26054
Nov 19, 2008 8:34
 

 

 

Thank you very much Tore...

#26058
Nov 19, 2008 10:16