This is a migrated thread and some comments may be shown as answers.

Rebinding problem after server validation

0 Answers 14 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
raphael
Top achievements
Rank 1
raphael asked on 22 Aug 2012, 08:04 AM
Hi I have a problem with my date picker.

In my form I have a date picker input, that I declared like that
@(Html.Telerik().DatePickerFor(model => model.InvoiceDate)
  .ShowButton(true)
 )

In my model the date is declared like that

public

 

 

DateTime? InvoiceDate { get; set; }

 


and in my controller i just do this

[HttpPost]
public ActionResult Create(InvoiceModel invoice)
{
    if (ModelState.IsValid)
     {
       _invoiceRepository.Insert(invoice);
     }
    return PartialView("_create", invoice);
}

the problem comes when I reload the partial view. on my page I select a date that is in the date picker like this 22/08/2012, then after the view is reloaded i get the date in my datepicker like this 2012-08-22T08:01:36Z
I cannot undestand what i'm doing wrong. can somebody help me?

Thank you
Tags
Date/Time Pickers
Asked by
raphael
Top achievements
Rank 1
Share this question
or