Datapicker is working good without Master Page but when i use Master page and content page, it is not working in Content Page. I am using the following code for Datapicker in Master page and Content page.
In the Head of Master page, I am writing the follwing code.
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript">
$(document).ready(function () {
$("#<%=txtFromDate.ClientID %>").datepicker({ dateFormat: 'dd-mm-yy' });
$("#<%=txtToDate.ClientID %>").datepicker({ dateFormat: 'dd-mm-yy' });
});
</script>
</asp:Content>
In Content Page I am writing the following code.
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript">
$(document).ready(function () {
$("#<%=txtFromDate.ClientID %>").datepicker({ dateFormat: 'dd-mm-yy' });
$("#<%=txtToDate.ClientID %>").datepicker({ dateFormat: 'dd-mm-yy' });
});
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table>
<tr>
<td>
From Date
</td>
<td>
<asp:TextBox ID="txtFromDate" runat="server" Width="220" ClientIDMode="Static"></asp:TextBox>
<span id="spnPDate" class="err" />
</td>
</tr>
<tr>
<td>
To Date
</td>
<td>
<asp:TextBox ID="txtToDate" runat="server" Width="220" ClientIDMode="Static"></asp:TextBox>
<span id="spnEDate" class="err" />
</td>
</tr>
</table>
</asp:Content>
How i will use Datapicker in Content Page. Please suggest me.