I have been struggling to get the datetime picker working with Asp.net 4.0. I have added the jquery-1.5.2.min.js and jquery-datepicker.js inside the scripts folder. I'm getting error message
Microsoft JScript runtime error: Object doesn't support this property or method
inside jquery-1.5.2.min.js .
I went through the similar questions posted in stackoverflow, but still not able to resolve the answer. I'm sure that the script path is not getting resolved properly. I tried different combinations adding the script tag in Master and also content page.It still did not work. I also tried ResolveUrl in content page, it still failed.
Updated code - still gives error for me.
' type="text/javascript">
' type="text/javascript">
' rel="stylesheet" type="text/css" />
$(document).ready(function ()
{
$("#<%=TextBox1.ClientID %>").datepicker();
});
</script>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<script type="text/javascript" src="../Scripts/jquery-1.5.2.min.js" ></script>
<script type="text/javascript" src="../Scripts/jquery-datepicker.js" ></script>
<script type="text/javascript" language="javascript">
$(document).ready(function ()
{
$(function () {
$("#<%=txtDateFrom.ClientID %>").datepicker();
});
}); /*----------------------End of Document Ready----------------------------*/
</script>
Can someone who has worked with Master and content pages and have included jquery datetime picker in the content page help me please?
.com/foo/bar/page.aspx
then your script points to.com/foo/jquer...
– Eonasdan<script src="@Url.Content("~/Scripts/jquery-ui-timepicker-addon.js")" type="text/javascript"></script>
I don't see a reference to a DateTimePicker, but if you need a good one use this – Shahin Dohan@Url
wouldn't work for him (I think). While I've used the timepicker you linked to it requiredjquery ui
which he's also not referencing. – Eonasdan