How to add & Display Date in Calendar Control in ASP.NET Core and store selected date in Calender Control in Database in dd-mm-yy format ?
Add & Display Date in Calendar Control in ASP.NET Core
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Vishal YelveRank #178 · 13.6K reputationPosted Mar 10, 2023, 7:01 AM EST
@{ ViewData["Title"] = "Home Page"; } @section scripts{ $(function () { $('#txtDate').datepicker({ changeMonth: true, changeYear: true, format: "dd/mm/yyyy", language: "tr" }); }); } @ViewBag.Message @if (ViewBag.Message != null) { $(function () { alert("@ViewBag.Message"); }); }public class HomeController : Controller { public IActionResult Index() { return View(); } [HttpPost] public IActionResult Index(string dDate) { ViewBag.Message = "Selected Date: " + dDate; return View(); } }Naimish MakwanaRank #324 · 7.7K reputationPosted Mar 10, 2023, 6:03 AM EST
Hello Suman,
refer below link
https://www.aspsnippets.com/Articles/ASPNet-Core-Bootstrap-DatePicker-Calendar-implementation.aspx
Thanks
Naimish Makwana