Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8601955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:57:50+00:00 2026-06-12T01:57:50+00:00

input class=text-box single-line data-val=true data-val-date=The field Bill Date must be a date. data-val-required=Bill Date

  • 0

input class=”text-box single-line” data-val=”true” data-val-date=”The field Bill Date must be a date.” data-val-required=”Bill Date is required” id=”BillDate” name=”BillDate” type=”date” value=”22.02.2012″

here is html code shown in source on chrome. But there is no value in the textbox.

And here is my model for the “BillDate”

    [Required]
    [Display(Name = "Bill Date")]
    [DataType(DataType.Date, ErrorMessage = "Not a valid date")]
    [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd.MM.yyyy}")]
    public DateTime BillDate { set; get; }

and this is how i am trying to display it @Html.EditorFor(model => model.BillDate)

Can you help me please…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:57:51+00:00Added an answer on June 12, 2026 at 1:57 am

    I had this exact same problem. I ended up looking at the HTTP Post that was going back to the Controller and the format of the date in the POST was yyyy-MM-dd.

    I changed my data annotation to this and it worked…

    [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
    

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's an example of what I mean: I have an array: array('type'=>'text', 'class'=>'input', 'name'=>'username',
I have these text inputs in a table : <td><input type='text' name='arrondi_devis_ht' class='calcul_total' size='8'></td>
I'm trying to update a text box from a class called 'hex' to the
I have an input text which is this: <div class=editor-label> @Html.LabelFor(model => model.EmployeeId, Employee
I have a fieldset with a text input box, with a submit button. I
I created several user controls - most containing a single web control (text box,
I have an input text box with the instance name of input_txt and a
I have datetime input in my ASP.NET MVC3 app: <div class=editor-field> @Html.EditorFor(model => model.Article.PublishedDate)
Is there a input class to deal with [multiple] large XML files based on
To select input ending with -top I can sue the following: $(input[class$='-top'],input[class*='-top ']) But,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.