i added those jquery files in umbraco at Scripts and css folders at the backend.the id "l1" belongs to a asp.net server control textbox.if i changed to alert("hi");it is working but the method in the jquery not calling.how to solve this.
1 .I see html and body tags in your usercontrol. Those shouldn't be there. That should be in your template.
2. You are using client dependency framework in your usercontrol to add css and js. But there is nothing defined for that in your template. You should have a clientdependency loader in your template:
1. In your template you already have the scripts referecend. But you have them enclosed in the ClientDependencyLoader. This will not work 2. In your usercontrol you reference your scripts with clientdependency, but with a different path (JS folder). Scripts in umbraco are usually placed in the scripts folder. Also are they enclosed in the clientdependency loader which is wrong 3. I don't see where you use your usercontrol in your template. It's not referenced directyly or as a macro.
i added that control to a docuemnt type "test" .that document type contains default date picker.the control (timepicker) working but default datepicker is not working?what is the problem?
jquery method not calling in umbraco 4.7.1.1?
timepicker() method is not executing correctly.
<umb:CssInclude ID="CssInclude2" runat="server" FilePath="~/jquery-ui-timepicker-addon.css" PathNameAlias="UmbracoClient" />
<umb:CssInclude ID="CssInclude1" runat="server" FilePath="~/jquery-ui.css" PathNameAlias="UmbracoClient" />
<umb:JsInclude ID="JsInclude4" runat="server" FilePath="~/jquery-ui.js" Priority="0" />
<umb:JsInclude ID="JsInclude2" runat="server" FilePath="~/scripts/jquery-ui-sliderAccess.js" />
<umb:JsInclude ID="JsInclude3" runat="server" FilePath="~/jquery-ui-timepicker-addon.js" />
<script type="text/javascript">
$(function () {
$('#l1').timepicker();
});
</script>
I don't see you including the jQuery library it self. Can this be the problem ?
Also you can try changing your script to
$(document).ready(function() {
$('#l1).timepicker();
});
Dave
thank you for replying me,
i added those jquery files in umbraco at Scripts and css folders at the backend.the id "l1" belongs to a asp.net server control textbox.if i changed to alert("hi");it is working but the method in the jquery not calling.how to solve this.
Do you include jQuery itself ? I don't see it in your code example
Dave
yes i included.
<link href="jquery-ui-timepicker-addon.css" rel="stylesheet" type="text/css" />
<link href="jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="Scripts/jquery-1.9.1.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui.js" type="text/javascript"></script>
<script src="jquery-ui-sliderAccess.js" type="text/javascript"></script>
<script src="jquery-ui-timepicker-addon.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#l1').timepicker();
});
</script>
even it is not working
can you try this code :
$(document).ready(function() {
$('#l1).timepicker();
});
And is #l1 the id ? Some times .NET controls render another ID on the clientside depending on framework version or settings.
i tried with this code and it is working if add total code in template then it working.but i need usercontrol with this.
Can you post the code of the user control ?
i did not write backend code .just i want to try to get user inteface of picker.is it correct procedure to include them in umbraco?
Can you post the code of usercontrol and template. Maybe then I can see what is going wrong ?
hi dawoe ,this is template and usercontrol code
this is the template code here it is working
<link rel="stylesheet" href="/css/jquery-ui.css" />
<link rel="stylesheet" href="/css/jquery-ui-timepicker-addon.css" />
<script src="/scripts/jquery-1.9.1.js" type="text/javascript"></script>
<script src="/scripts/jquery-ui.js" type="text/javascript"></script>
<script src="/scripts/jquery-ui-sliderAccess.js" type="text/javascript"></script>
<script src="/scripts/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#ContentPlaceHolderDefault_l2').timepicker();
});
</script>
<form id="f1" runat="server">
<asp:TextBox runat="server" ID="l2" ></asp:TextBox>
</form>
this is ascx usercontrol not working
<html >
<head >
<title></title>
<umb:CssInclude ID="CssInclude2" runat="server" FilePath="~/Css/jquery-ui-timepicker-addon.css" />
<umb:CssInclude ID="CssInclude1" runat="server" FilePath="~/Css/jquery-ui.css" />
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="~/Js/jquery-1.9.1.js" Priority="1" />
<umb:JsInclude ID="JsInclude4" runat="server" FilePath="~/Js/jquery-ui.js" Priority="2" />
<umb:JsInclude ID="JsInclude2" runat="server" FilePath="~/Js/jquery-ui-sliderAccess.js" Priority="3" />
<umb:JsInclude ID="JsInclude3" runat="server" FilePath="~/Js/jquery-ui-timepicker-addon.js" Priority="4" />
<script type="text/javascript">
$(function () {
$('#ContentPlaceHolderDefault_l1').timepicker();
});
</script>
</head>
<body>
<asp:TextBox runat="server" ID="l1" ></asp:TextBox></div>
</body>
</html>
it is not working
Hi,
A few things i notice :
1 .I see html and body tags in your usercontrol. Those shouldn't be there. That should be in your template.
2. You are using client dependency framework in your usercontrol to add css and js. But there is nothing defined for that in your template. You should have a clientdependency loader in your template:
3. The ID of your textbox and the one in your javascript don't match.
Dave
hi dave
i tried deleting html tags even the function not gettiing output in usercontrol.
Hi,
Did you check point 2 of my previous post ? Or have you tried including the javascript and css without the use of the client dependency framework ?
yeah tried .but in template also it is showing error.
in usercontrol "clientdependecy exitsmore than once" error coming
Can you post the template and the usercontrol code again like you have it now ?
this is the usercontrol
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
<umb:ClientDependencyLoader runat="server" ID="ClientDependencyLoader">
<umb:CssInclude ID="CssInclude2" runat="server" FilePath="~/Css/jquery-ui-timepicker-addon.css" />
<umb:CssInclude ID="CssInclude1" runat="server" FilePath="~/Css/jquery-ui.css" />
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="~/Js/jquery-1.9.1.js" Priority="1" />
<umb:JsInclude ID="JsInclude4" runat="server" FilePath="~/Js/jquery-ui.js" Priority="2" />
<umb:JsInclude ID="JsInclude2" runat="server" FilePath="~/Js/jquery-ui-sliderAccess.js" Priority="3" />
<umb:JsInclude ID="JsInclude3" runat="server" FilePath="~/Js/jquery-ui-timepicker-addon.js" Priority="4" />
</umb:ClientDependencyLoader>
<script type="text/javascript">
$(function () {
$('#test').timepicker();
});
</script>
<div id="test">
<asp:TextBox runat="server" ID="txt"></asp:TextBox></div>
I need the template too
<cd:ClientDependencyLoader ID="ClientDependencLoader" runat="server">
<link rel="stylesheet" href="/css/jquery-ui.css" />
<link rel="stylesheet" href="/css/jquery-ui-timepicker-addon.css" />
<script src="/scripts/jquery-1.9.1.js" type="text/javascript"></script>
<script src="/scripts/jquery-ui.js" type="text/javascript"></script>
<script src="/scripts/jquery-ui-sliderAccess.js" type="text/javascript"></script>
<script src="/scripts/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
</cd:ClientDependencyLoader>
<script type="text/javascript">
$(function () {
$('#ContentPlaceHolderDefault_l2').timepicker();
});
</script>
I see several problems now.
1. In your template you already have the scripts referecend. But you have them enclosed in the ClientDependencyLoader. This will not work
2. In your usercontrol you reference your scripts with clientdependency, but with a different path (JS folder). Scripts in umbraco are usually placed in the scripts folder. Also are they enclosed in the clientdependency loader which is wrong
3. I don't see where you use your usercontrol in your template. It's not referenced directyly or as a macro.
I think this code should help you :
Template :
Usercontrol :
Dave
Hi Siva,
Did you manage to get it working ?
Dave
yes i managed now working
thank you for your help
one more thing i want to ask you
i want to create one of the pdf pages as a thumbnail for pdf ?how ?
Here is code example of how to create PDF thumbnails :
http://www.web-garden.co.uk/blog/2013/4/18/generating-thumbnail-images-for-pdfs-in-umbraco
i added that control to a docuemnt type "test" .that document type contains default date picker.the control (timepicker) working but default datepicker is not working?what is the problem?
is working on a reply...