A newer version of this page is available. Switch to the current version.

ASPxNewsControl Class

Represents an ASPxNewsControl.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll


public class ASPxNewsControl :
Public Class ASPxNewsControl
    Inherits ASPxDataViewBase
    Implements IControlDesigner


The ASPxNewsControl is designed to display news or announcements on a web page. This control is shown in the image below:


The ASPxNewsControl can function in bound and unbound modes:

To access item settings, use the ASPxNewsControl.ItemSettings property. For more information on item settings, see NewsItem.

To allow end-users to immediately navigate to the top of the current page, set the ASPxNewsControl.ShowBackToTop property to true. This shows the Back to top link within items. To specify a custom text for this link, use the ASPxNewsControl.BackToTopText property. It's also possible to display an image before this link, by specifying the ASPxNewsControl.BackToTopImage property.


The ASPxNewsControl control provides you with a comprehensive client-side functionality implemented using JavaScript code (see DevExpress.Web.Scripts to learn more):

The client-side API is always available for this control.


This example demonstrates how the ASPxNewsControl control can be customized to make use of the SEO-friendly paging feature.

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" 
Inherits="_Default" %>
<%@ Register Assembly="DevExpress.Web.v8.3, Version=, Culture=neutral, 
    Namespace="DevExpress.Web.ASPxNewsControl" TagPrefix="dxnc" %>  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

<script runat="server">

<html xmlns="" >
 <head id="Head1" runat="server">
     <title>SEO-friendly paging in the ASPxNewsControl</title>
     <form id="form1" runat="server">

         <dxnc:ASPxNewsControl ID="ASPxNewsControl1" runat="server" 
             NavigateUrlFormatString="javascript:void('{0}');" Width="100%" >
             <PagerSettings SEOFriendly="Enabled"></PagerSettings>
             <ItemSettings ShowImageAsLink="True" MaxLength="120" TailText="Details" />

        <asp:XmlDataSource ID="dsSampleDataSource" runat="server" 
            TransformFile="~/App_Data/NewsControlRSS.xslt" XPath="//item" />     
See Also