Search results

Localization in ASP.NET MVC ComboBox control

08 Apr 2021 / 1 minute to read

The Localization library allows you to localize static text content of the noRecordsTemplate and actionFailureTemplate properties according to the culture currently assigned to the ComboBox.

Locale key en-US (default)
noRecordsTemplate No records found
actionFailureTemplate The request failed

Loading translations

To load translation object to your application, use load function of L10n class.

In the following sample, French culture is set to the ComboBox and no data is loaded. Hence, the noRecordsTemplate property displays its text in French culture initially, and if the sample is run offline, the actionFailureTemplate property displays its text appropriately.

Copied to clipboard
@Html.EJS().ComboBox("customers").Placeholder("Select a customer").PopupHeight("200px").Locale("fr-BE").DataSource(dataManger =>
            dataManger.Url("").Adaptor("ODataV4Adaptor").CrossDomain(true)).Fields(new Syncfusion.EJ2.DropDowns.ComboBoxFieldSettings
                Value = "ContactName"
            }).Query("new'Customers').select(['ContactName', 'CustomerID']).take(0)").Render()

        'fr-BE': {
            'dropdowns': {
                'noRecordsTemplate': "Aucun enregistrement trouvé",
                'actionFailureTemplate': "Modèle d'échec d'action"
Copied to clipboard
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using WebApplication1.Models;

namespace WebApplication1.Controllers
    public class ComboBoxController : Controller
        public ActionResult localization()
            return View();

See Also