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

  • SEARCH
  • Home
  • 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 8027095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:42:33+00:00 2026-06-04T23:42:33+00:00

I have a @Html.TextboxFor and its connected to datepicker class, it also displays a

  • 0

I have a @Html.TextboxFor and its connected to datepicker class, it also displays a date out a database. How ever it displays the date in the wrong format. When the date is displayed out the DB, that is the only time the date is in the wrong format.

@Html.TextBoxFor(model => model.AdvertiserSignDate, new { id = "txtAdvDate", @readonly = "true", @class = "DatePicker" })

This code below displays the date in the correct format but just on a line below the text box.

@(Model == null ? string.Empty : String.Format("{0:dd MMM yyyy}", Model.AdvertiserSignDate))  

I would like to add the formatting of the line above to the first line, so that my textbox displays the date in the correct format and has the function of the date picker.

How can i merge these two lines of code?

  • 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-04T23:42:35+00:00Added an answer on June 4, 2026 at 11:42 pm

    This works.

    @Html.TextBox("AdvertiserSignDate", String.Format("{0:dd MMM yyyy}", Model.AdvertiserSignDate), new { id = "txtAdvDate", @readonly = "true", @class = "DatePicker" })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So let's say I have a view that access a date: <%= Html.TextBoxFor(model =>
I have a form containing a date and datetime field: @Html.TextBoxFor(model => model.A, new
I am using Model binding with the Entity Framework and have an Html.TextBoxFor(model =>model.date)
I have tried: @Html.TextBoxFor(m => m.UserName, new {@class='textbox'}) which isn't working.
I have the following tag with a Html.TextBoxFor expression and I want the contents
I have a <%= Html.TextBoxFor(user => user.Name) %> and it has standart width. What
I have an ASPNET MVC 2 project. When I use <%= Html.TextBoxFor(model => model.Login)
I have the following <label for=Forename>Forename</label> <%= Html.TextBoxFor(m => m.Customer.Name.Forename) %> the problem with
I have html code like this <tr class=odd> <td><b>Reason for Termination:</b></td> <td>this has bunch
I have HTML like this: <a href=# class=modalInput glow rel=#newsletter >Newsletter!</a> This opens a

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.