Search results

Set the Readonly in ASP.NET MVC DatePicker control

23 Feb 2021 / 1 minute to read

The following example demonstrates how to set readonly in DatePicker control. You can achieve this by using readonly property.

@Html.EJS().DatePicker("datepicker").Readonly(true).Value(ViewBag.value).Placeholder("Choose a Date").Render()
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace EJ2CoreSampleBrowser.Controllers
    public class HomeController: Controller
        public ActionResult sample()
            ViewBag.value = new DateTime(DateTime.Now.Year,DateTime.Now.Month,14);
            return View();