I may be adding my 2 cents quite late, but I thought it might help some people in the future. As mentioned by Rob, with .Net 4.5 you can use TextMode="Date" for your asp:TextBox , but browser support may be limited, as this will cause the TextBox to become an HTML5 date type text box in the output of the page. Most modern browsers support HTML5 from the moment I write this.
However, if this is what you want, then there is no problem with your markup.
<asp:TextBox ID="lastDate" runat="server" autocomplete="off" TextMode="Date" />
If you see this error message in Visual Studio Visual Studio, it is most likely due to the wrong version of the target environment.
Change the Target-Framework property in your Web.Config as follows to get rid of this error.
Web.Config> configuration> system.web> compilation
<compilation debug="true" defaultLanguage="C#" targetFramework="4.5" />
Hope this helps
Nashe source share