Click here to Skip to main content
12,822,497 members (47,429 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET C#4.0
how to validate calendar extender on a has to take only date i have use filtered control and gave valid char as no's is working fine but if we press no's in that text box it is taking i have to avoid that and it has to allow only date to be selected from that calendar...pls reply
Posted 21-Feb-12 18:36pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

try this:-

There is a soluton that works across the browsers. Put
onKeyPress = "javascript: return false;" onPaste = "javascript: return false;"
in your textbox. That way, even the textbox is enabled, the user will not be able to modify the data.

Please refer the links for more details:-[^][^][^]

I hope this will help you out.

Kiirrii 22-Feb-12 0:08am
onKeyPress = "javascript: return false;"
sweet and simple thanks...
Varun Sareen 22-Feb-12 0:09am
your welcome dear
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Dear disable the textbox so that nobody can access textbox
Kiirrii 21-Feb-12 23:45pm
if u make it as disable calender wil not come....
ashumeerut 12-Aug-13 1:52am
backspace is working, problem
Varun Sareen 21-Feb-12 23:58pm
absolutely right
Kiirrii 21-Feb-12 23:48pm
Used Calender Extender dude on that textbox disable not works..
Rate this: bad
Please Sign up or sign in to vote.

Solution 3


I think you should set your textboxt to read only mode....
If you are using ajax toolkit then...

See this sample code:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<td align="left">
   Admission Date:

Please do not forget to vote if could help...
sofia3 4-Jun-12 9:20am
if you will do read only textbox value will be empty on code behind it will not set no matter in frontend it will be displayed.
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

Hi there,
If you are using ajax calender extender then use this:

<asp:TextBox CssClass="controls" ID="txtPOITo" runat="server" Width="125px" ReadOnly="True" />
<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Images/Calendar_scheduleHS.png"/>
<cc1:CalendarExtender ID="CalendarExtender2" TargetControlID="txtPOITo" Animated="true"
PopupButtonID="ImageButton2" Format="dd/MM/yyyy" PopupPosition="BottomRight" runat="server">

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.170308.1 | Last Updated 22 Feb 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