- 2 minutes to read
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 bind the control to a data source, use its ASPxDataWebControl.DataSourceID property. To indicate the way the control's items are populated from the data source, use the following properties:
- ASPxNewsControl.DateField - specifies the data source field which provides item dates;
- ASPxNewsControl.HeaderTextField - specifies the data source field which provides a content to item headers;
- ASPxNewsControl.ImageUrlField - specifies the data source field which provides the URLs of item images;
- ASPxNewsControl.NavigateUrlField - specifies the data source field which provides item URLs;
- ASPxNewsControl.TextField - specifies the data source field which contains item descriptions.
To populate items, use the methods provided by the ASPxNewsControl.Items collection. The collection provides methods and properties that allow you to add new items and remove existing ones, access individual items, etc.
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 control's client-side equivalent is represented by the ASPxClientNewsControl object.
- On the client side, the client object can be accessed directly by the name specified via the ASPxDataViewBase.ClientInstanceName property.
- The available client events can be accessed by using the ASPxNewsControl.ClientSideEvents property.
The client-side API is always available for this control.