0

I have textbox like that (VS 2010):

<asp:TextBox type="date" ID="rSLA" runat="server" ></asp:TextBox>

and it's working fine, but when I change the type to : datetime (cause I need date and hour) , the datepicker not working. why?

Thank you.

2
  • 1
    This is new html5 date types. you can read about it here: wufoo.com/html5/types/4-date.html Commented Mar 16, 2014 at 19:53
  • 1
    adding TextMode="DateTimeLocal" instead of type="date" fixed my problem in this case and it gave me a datepicker Commented May 20, 2014 at 19:17

3 Answers 3

4

Which browser are you using? I notice on there that for Chrome, datetime is unsupported but datetime-local is, maybe that solves your problem.

Sign up to request clarification or add additional context in comments.

1 Comment

thanks, this fixed my problem, but on my IDE (VS2013) its DateTimeLocal instead of datetime-local!
0

setting type="datetime" for textbox it Doesn't Mean that it will show calender for You. You can Use Calender from Ajax

in front of TextBox

<asp:TextBox ID="rSLA" runat="server" ></asp:TextBox>
<asp:Calendar ID="Calendar1" runat="server" Width="150px" 
                DayNameFormat="Shortest"  Height="25px" /> 
            </asp:Calendar> 

Refer this http://www.codeproject.com/Articles/19991/DatePicker-in-ASP-NET-and-AJAX-Control-Toolkit

1 Comment

0

If you're trying to use HTML5 datetime input type, it's good to check on what browsers support it first. According to this, it only appears a few mobile browsers are supported. So instead you should use a 3rd party Datepicker. There's a built-in one that doesn't work very well, there's one in the Ajax Control Toolkit that works well, jQuery UI has one (that's my personal pref) or you can Google for one.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.