0

Currently, I have several control files (ascx) that have their own 'includes' between javascript 'script' tags:

document.write('<link href="/SiteAssets/Content/jquery.ui.1.10.0.ie.css" rel="stylesheet" />');
    document.write('<link href="/SiteAssets/Content/jquery-ui-1.9.2.custom.css" rel="stylesheet" />');
    document.write('<link href="/SiteAssets/Content/jquery-ui-1.10.0.custom.css" rel="stylesheet" />');

We're having problems where some files are duplicated and an attempt to load more than once is causing problems. What I'm trying to do is use Sharepoint:ScriptLink tags in one file that will be called by each control file. From my reading, Sharepoint:ScriptLink only loads files once and duplicates are ignored ( http://yakovenkomax.com/cssregistration-and-scriptlink-done-the-right-way/ ). I've also read a way to do it on a previous post [ASCX controls, how to prevent multiple inclusions of same Javascript file?

However there are a number of controls so this isn't an elegant solution. What I want to do is create one file, with all dependencies, that can be referenced by each ascx.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.