Pass selected date to Controller

Hi Team,

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



Thanks,

1 Reply

DL Deepa Loganathan Syncfusion Team 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. 


Loader.
Up arrow icon