Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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
good
Please Sign up or sign in to vote.

Solution 1

use ajax calander in Asp.net
 

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">
    </asp:scriptmanager>
 
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">
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

There is maskedinput jquery plugin which probably serve your purpose.
 
http://plugins.jquery.com/project/maskedinput[^]
  Permalink  

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



Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 11 Oct 2012
Copyright © CodeProject, 1999-2014
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