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.
Unfortunately, activation email could not send to your email. Please try again.

DatePickerFor

Thread ID:

Created:

Updated:

Platform:

Replies:

117907 Jan 7,2015 10:54 AM Jan 19,2015 07:54 AM ASP.NET MVC 5
loading
Tags: DatePicker
Andrea Perazzolo
Asked On January 7, 2015 10:54 AM

Hi,
I am using the DatePickerFor Helper in MVC 5.
I am putting it in a page with a Grid.
I Noticed that when the Unobtrusive Support is turned off, it renders as a simple textbox and not as the DatePicker.
Now I am using the disabled Unobtrusive only for showing data on the Hierarchical grid i specified in another post today, and then when it will be resolved I'll switch back to that behavior, but it seems strange to me that it won't work. I have seen hat this helper works in your examples, and when I have checked the sources I have seen that the property in Web.COnfig is set fo False.

Maybe there is a conflict between the two controls in the same page?

    Thanks in advance

   Andrea Perazzolo

Kaliswaran Shanmuga Sundaram [Syncfusion]
Replied On January 8, 2015 07:49 AM

Hi Andrea,

Sorry for the Inconvenience caused.

We have analyzed the reported issue (When the Unobtrusive Support is turned off, the DatePickerFor renders as a simple textbox and not as the DatePicker) and we are not able to reproduce it.

We have prepared a simple sample based on your requirement. You can also download the attached sample from the following location.

Sample: Sample

In the above sample, we have used the DatePickerFor with the form. When we submit the form the selected date value is send in postback. The submitted date value displayed in the view page.

We have also tried this with the grid sample. In this sample also we cannot reproduce the above reported issue. Both the controls are working fine.

If you still face any problems, please revert back us the attached sample with replication procedure. So that we could provide the exact solution at earliest.

Please let us know if you have any queries.

Regards,

Kaliswaran S


Andrea Perazzolo
Replied On January 9, 2015 06:05 AM

I am able to reproduce the problem even in your example, changing a little the code:

public class Incident
{
    public Incident()
    {
        TempContainer = new Container();
    }
 
    DateTime dt = DateTime.Now;
 
    public DateTime datepicker1
    {
        get;
 
        set;
 
    }
 
    public Container TempContainer { getset; }
 
}
 
public class Container
{
    public DateTime TempDate { getset; }
 
    public Container()
    {
        TempDate = DateTime.Now.AddMonths(2);
    }
}

I have put a DateTime property inside another class

<div class="datepickerDiv">
    @Html.EJ().DatePickerFor(model => model.datepicker1, (Syncfusion.JavaScript.Models.DatePickerProperties)ViewData["date"])
</div>
 
<div class="datepickerDiv">
    @Html.EJ().DatePickerFor(model => model.TempContainer.TempDate, (Syncfusion.JavaScript.Models.DatePickerProperties)ViewData["date"])
</div>
The First DatePicker renders correctly, the seconnd is a simple Textbox

  Andrea Perazzolo





Kaliswaran Shanmuga Sundaram [Syncfusion]
Replied On January 12, 2015 07:28 AM

Hi Andrea,

Sorry about the Inconvenience caused.

We are able to reproduce the reported issue (When I use two DatePickerFor in same page with different Properties, The first DatePicker renders correctly, the second is a simple Textbox). We have confirmed this as a defect and an issue report has been logged for this. Fix for this issue will be available in our upcoming service pack release for ASP.NET MVC which is expected to be rolled out at the end of this month (January 2015). We will notify you once our service pack release is rolled out.

If you are in need of a solution sooner, then please let us know about this. So that we could provide a patch for this issue before service pack release.

Please let us know if you have any queries.

Regards,

Kaliswaran S


Andrea Perazzolo
Replied On January 15, 2015 11:29 AM

Hi,
I just noticed that the DatePickerFor problem appears even on the DropDownListFor
Maybe is a more general problem that happens with Other MVC Helpers.

    Andrea Perazzolo

Kaliswaran Shanmuga Sundaram [Syncfusion]
Replied On January 19, 2015 07:54 AM

Hi Andrea,

Thanks for your update.

Query: I just noticed that the DatePickerFor problem appears even on the DropDownListFor. Maybe is a more general problem that happens with Other MVC Helpers.

We have already validated the above reported issue for all “Form” controls not only for “DataPickerFor” and we will deliver the fix for all “Form” controls.

Please let us know if you have any queries.

Regards,

Kaliswaran S

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.

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.

;