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)

  Print Answers RSS
0 mhegazy94 460
1 Sergey Alexandrovich Kryukov 400
2 Kornfeld Eliyahu Peter 315
3 Gihan Liyanage 147
4 Sibeesh KV 145
0 Sergey Alexandrovich Kryukov 6,890
1 OriginalGriff 6,761
2 CPallini 5,350
3 George Jonsson 3,609
4 Gihan Liyanage 2,797


Advertise | Privacy | Mobile
Web04 | 2.8.140922.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