Click here to Skip to main content
13,044,428 members (123,101 online)
Rate this:
Please Sign up or sign in to vote.
See more:
hello guys,

I'm need to format a textbox so that it displays '__/__/___' -- MM/DD/YEAR. Is there a built-in function that facilitates this functionality, or should I just manually fight thru it?

THanks in advance.
Posted 11-Oct-12 2:41am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

use ajax calander in

First rgister ajax tool kit in the .aspx page
<![CDATA[<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>]]>

Then take Script manager

<asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">

Then Use code given blow

<asp:textbox id="txtFrom" runat="server" maxlength="10" onblur="CalculateDays();" width="100" xmlns:asp="#unknown"></asp:textbox> 
 <img id="Img2" src="Images/Calendar.png" runat="server" alt="" />
<cc1:calendarextender id="CalendarExtender2" runat="server" popupbuttonid="Img2" xmlns:cc1="#unknown">
TargetControlID="txtFrom" Format="dd/MM/yyyy">
<cc1:maskededitextender id="MaskedEditExtender1" runat="server" mask="99/99/9999" xmlns:cc1="#unknown">
 MaskType="Date" TargetControlID="txtFrom" PromptCharacter="_">
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

There is maskedinput jquery plugin which probably serve your purpose.[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 11 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100