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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Pass selected date to Controller

Thread ID:

Created:

Updated:

Platform:

Replies:

141273 Dec 3,2018 03:47 PM UTC Dec 4,2018 10:48 AM UTC ASP.NET MVC - EJ 2 1
loading
Tags: DatePicker
jsu
Asked On December 3, 2018 03:47 PM UTC

Hi Team,

Could you please help me to pass selected date of datepicker and  selected value of dropdownlist from View to Controller?



Thanks,

Deepa Loganathan [Syncfusion]
Replied On December 4, 2018 10:48 AM UTC

Dear Customer,  
 
 
Thanks for contacting Syncfusion support.  
 
 
You can pass the selected Date and the Value from Dropdownlist to the controller in the post action of the form, where the posted values can be accessed in the controller as given in the below code. 
 
 
 
[HttpPost] 
        public ActionResult Index(DateTimePickerModel model) 
        { 
            //posted value is obtained from the model 
            ViewBag.country = new Country().CountryList(); 
            datetimepicker.objectValue = model.objectValue; //Datepicker 
            datetimepicker.CountryId = model.CountryId; //Droprdownlist 
 
            return View(datetimepicker); 
        } 
 
 
 
We have prepared a sample based on your requirement. Please check the below link.  
 
 
 
 
Please get back to us if you have any further queries. 
 
 
Regards,  
 
Deepa L. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon