Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a master page and a content page. I have referenced the jquery, jquery-ui files in the master page. I have a user control where I have a text box which needs to attache to datepicker.

The problem is when I attach datepicker to textbox in document.ready function of user control, i get error like datepicker is not defined.

When I give reference to jquery, jquery-ui files in user control, then the datepicker is working fine. But, the issue is I am calling jquery, jquery-ui files twice which is breaking other functionality.

Can you please help to attach the datepicker without loading jquery files twice
Posted
Comments
[no name] 21-May-15 8:53am    
Date picker working with the ref,can u post your code here.then only we know that the exact problem.
Gopi Kishan Mariyala 21-May-15 8:58am    
The code is in remote server and could not put it here. I have no net accessibility in the remote server. We are using single page architecture
Gopi Kishan Mariyala 21-May-15 10:23am    
On further analysis, i found that when I am calling jquery script in user control, I am getting DOM object. When I am not calling jquery in user control, I am getting jquery object. Not sure why I am getting different version on object

JavaScript
//Check the references 

https://jqueryui.com/datepicker/[^]
 
Share this answer
 
After multiple team members checked the issue, we found that the jquery file was getting loaded multiple times. This was happening because we added jquery file reference in aspx page and then we have add the same file in code behind file as web resource. So the same file was getting loaded multiple times. Other than that, when we were using jquery-ui.min.js we were getting element msie is not defined. But, when we used jquery-ui.js we did not get this error.

The main issue is multiple loads of jquery file.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900