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 9024189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:56:40+00:00 2026-06-16T05:56:40+00:00

I have a custom helper for a DateTime attribute in my model. The helper

  • 0

I have a custom helper for a DateTime attribute in my model.

The helper return Html for 3 selects one for day, one for months and the lasts one for years.

I have :

        public static MvcHtmlString DateFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression)
        {
         ...
        }

And I’m wondering how to linked the choice of the user when I submit the form into my model dateTime Attribute.

In fact I would like to do the same thing as the EditorFor Helper. If I have for example :

@Html.EditorFor(model => model.UserName)

Where userName is a sring. It return a textBox html input and when I submit my form the userName attribute is automatically filled with the field value.

  • 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-16T05:56:42+00:00Added an answer on June 16, 2026 at 5:56 am

    You could write a custom model binder for the DateTime type and a custom editor template to present the UI however you like. Scott Hanselman blogged about this. And here’s an updated version.

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

Sidebar

Related Questions

I have build a custom Html Helper extension as follows: public static string DatePicker(this
I have a custom html helper: public static MvcHtmlString MyLink(this HtmlHelper htmlHelper, string linkText,
I have custom html helper which getting IEnumerable model from view and generates html
We have a custom HTML helper with the following signature. public static MvcHtmlString TextBoxFor<TModel,
I have a custom helper that i use for logging. Within one of the
I have a custom ValidationSummary helper: namespace System.Web.Mvc.Html { using System; using System.Collections.Generic; using
I have strongly typed list view I have custom html helper which must get
I have a custom handlebar helper: Handlebars.registerHelper('foo', function(key) { return (key + ' bar');
I have a custom helper, as follows: Handlebars.registerHelper('hasAccess', function(val, fnTrue, fnFalse) { return val
I have used this custom Helper in My Razor View. @Html.Link(OpenewWindow, Constants.Value, new {

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.