How to Show Datepicker in Gridview

Posted by Jayakumars under ASP.NET on 8/17/2013 | Points: 10 | Views : 3752 | Status : [Member] [MVP] | Replies : 1

how to Show Gridview JQuery Datepicker with masked control and is date validate

i am using like this but id date and masked control not working

My Code this Client Side

<asp:TextBox ID="TxtDate" ClientIDMode="Static"
Width ="60px" runat ="server" Text =""></asp:TextBox>

<asp:MaskedEditExtender ID="MaskedEditExtender4" runat="server"
MaskType="Date" TargetControlID="TxtDate"
Mask="99/99/9999" CultureName="en-GB"
MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError" ClearMaskOnLostFocus="false"
DisplayMoney="Left" AcceptNegative="Left" />

<asp:MaskedEditValidator ID="MaskedEditValidator4" runat="server"
ControlExtender="MaskedEditExtender4" SetFocusOnError="false"
ForeColor ="Red" Display="Dynamic" ControlToValidate="TxtDate" IsValidEmpty="true"
EmptyValueMessage="Date is required" InvalidValueMessage="Date is invalid"
ValidationGroup="dateValidator1" TooltipMessage="Input a Date" />


Server Side

var DtShmt = (TextBox)e.Row.FindControl("TxtDate");
ClientScript.RegisterStartupScript(this.GetType(), "datepick",
"$(function () { $('#" + DtShmt.ClientID + "').datepicker({ dateFormat: 'dd/mm/yyyy' }); })", true);

here what is mistake my code any one solve this

Mark as Answer if its helpful to you
EmailId :


Posted by: Satyapriyanayak on: 8/18/2013 [Member] [MVP] Silver | Points: 25


If this post helps you mark it as answer

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response