We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

DatePicker

How do I call an action on a controller when a date is selected


1 Reply

KD Krishnaraj D Syncfusion Team March 6, 2012 04:36 PM UTC

Hi Christian Sandoy,

Thanks for using Syncfusion Products.

We have provided “OnDateSelected” event, which gets triggered whenever date is selected. In your case, you can use $.ajax to call particular action.

Refer the following steps.

1.Render the control and set the “OnDateSelected("OnSelect")” event in View Page as mentioned below.

@{
Html.MobSyncfusion().DatePicker("DataPicker5").AutoFormat(MobSkins.DarkNight).Mode(Mode.Simple).OnDateSelected("OnSelect").Render();
}


2.Refer the below script to handle “OnDateSelected” event.




3.Get the values in Post Action as mentioned below and call the action as your desired.

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult OnSelect(Mode Value)
{
return View();
}

For your additional reference we have attached a sample hereby. Please let us know if you have any further concerns.

Thanks,
Krishnaraj D



DatePicker_71de051d.zip

Loader.
Live Chat Icon For mobile
Up arrow icon