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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:51:56+00:00 2026-05-23T07:51:56+00:00

I have a modal dialog in my web application where users are able to

  • 0

I have a modal dialog in my web application where users are able to enter a time range between 00:00 and 24:00. A range slider is used to select this range.

Everything works as expected except that whenever user sets the right range handle to have a value of 24:00 default model binder can’t parse this TimeSpan.

public class Timing
{
    public TimeSpan Starts { get; set; }
    public TimeSpan Ends { get; set; }
}

My object that gets sent back to server has an IList<Timing> property.

So. The problem is just that string value “24:00” can’t be parsed to TimeSpan instance. Is it possible to convince default model binder to recognise such string value?

I would like to avoid changing 24:00 on the client to 00:00. I know that I have Starts and Ends properties but my model validation validates that Ends is always greater than Starts. Manual changing to 23:59 is also cumbersome. Basically is it possible to pass 24:00 and still get parsed on the server.

  • 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-05-23T07:51:56+00:00Added an answer on May 23, 2026 at 7:51 am

    I think the range is fractionally too large. 24:00 is in fact 00:00 the next day.
    so they should go from 00:00.00 to 23:59.99 or whatever.

    FINAL ANSWER(?) Change 24:00 on the client to 1.0:00.
    This will work because TimeSpan.Parse("1.0:00").TotalHours returns 24

    EDIT: See the documentation here: http://msdn.microsoft.com/en-us/library/se73z7b9.aspx. It shows the maximum range for days, hours, mins, etc. For hours it’s 0 to 23 as per my comment below.

    EDIT: If you are just letting them choose an integer for hours, then parse it on the server.

    eg. TimeSpan ts = TimeSpan.FromHours(24)
    returns 1.00:00:00
    And of course you can always say ts.TotalHours and it returns 24.

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

Sidebar

Related Questions

I have a modal dialog in main page, then I add jPlayer to this
I want to have a modal dialog over part of a web page, just
I am using the Basic Modal Dialog in my ASP.NET web application. In the
I have a web page and a modal dialog page. On clicking the save
On my web page I have a button that opens a modal jQuery dialog.
I have a problem with Jquery UI modal dialogs. I have modal dialog (dialogA),
I have a modal dialog that is created with the following: procedure TFormCompose.createParams(var Params:
I have a modal dialog plugin written in jquery, that binds to the click
I have a modal dialog box presented in Yahoo UI. The user selects a
I like to have a popup modal dialog that need to show the list

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.