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

DatePickerFor Not rendering (Error with Method Not Found) ?

I'm trying to use the Date Picker on a page Insert page

The View contains

 @Html.EJ().DatePickerFor(model => model.DateOfBirth)


and the mode includes the property

Datetime? DateOfBirth

But i get this error

Method not found: 'Syncfusion.JavaScript.DatePickerPropertiesBuilder Syncfusion.JavaScript.DatePickerExtension.DatePickerFor(Syncfusion.MVC.EJ.EssentialJavaScriptFor`1<!!0>, System.Linq.Expressions.Expression`1<System.Func`2<!!0,!!1>>)'.



Note: first time using the SyncFusion MVC tools - followed the setup guide and can confirm that a grid loads and binds correctly so i believe i've setup the mvc controls okay




1 Reply

SN Sasikala Nagarajan Syncfusion Team November 30, 2015 11:27 AM UTC

Hi Brian,
Thanks for contacting Syncfusion support,
We have analyzed your query and we are unable to reproduce the reported issue in our end. But we suspect the issue may be caused due to the may be the Date Picker control properties are accessed in  controller page without specifying the Syncfusion JavaScript name space in a controller.
Please refer the below code example:

[controller]

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

using Syncfusion.JavaScript;

using Syncfusion.JavaScript.Models;

using WebApplication6.Models;


namespace WebApplication6.Controllers

{

    public class DatePickerController : Controller

    {

       

        public ActionResult Index()

        {

            Incident inc =new Incident();

            inc.SampleDate = DateTime.Now;

            DatePickerProperties dateobj = new DatePickerProperties();

            dateobj.Width = "200px";

            dateobj.DateFormat = "dd/MM/yyyy";

            ViewData["dateobj"] = dateobj;

            return View(inc);

           
        }


 

We have prepared the simple sample with date picker for control. Please get the sample from below location.

Sample : http://www.syncfusion.com/downloads/support/forum/121294/ze/WebApplication6_(3)-716941582

Please check the given sample comparing with your project and let us know if it helps. If still you are facing the problem, please reproduce the issue in given sample and revert us. So that we can check in our side and provide you with a better solution

Regards,

Sasikala Nagarajan


Loader.
Live Chat Icon For mobile
Up arrow icon