New to Telerik UI for ASP.NET MVC? Download free 30-day trial

ASP.NET MVC Chat Data Binding

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
data_binding.cshtml
Data_BindingController.cs

Also available for:

CLIENT-SIDE API SERVER-SIDE API

Description

The Telerik UI for ASP.NET MVC Chat supports local and remote data binding that allows you to load messages from a local collection or specify a remote endpoint that returns the underlying data.

To configure the Chat for remote data-binding, you need to specify a remote endpoint or web service returning data in a JSON or JSONP format, and utilize the Telerik UI for ASP.NET MVC DataSource as a mediator between the component and the underlying data.

To make the connection to the remote endpoint and process the data properly, the DataSource requires information about the web service URL. Also, you must specify the following options within the Chat configuration that map the Model properties in the data collection:

  • TextField()
  • AuthorNameField()
  • AuthorIdField()
  • AuthorImageAltTextField()
  • AuthorImageUrlField()
  • TimeStampField()
  • IdField()
  • IsDeletedField()
  • FilesField()
  • IsTypingField()

This example demonstrates how to bind the Chat to remote data by configuring its DataSource().

Additional Apps

This Chat example is part of a unique collection of hundreds of ASP.NET MVC demos, with which you can see all Telerik ASP.NET MVC components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in the ThemeBuilder.

Support & Learning Resources

Additional Resources