How to Show Datepicker in Gridview

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

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


(No response found.)

Login to post response