MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

What is the correct way to include jQuery-ui.css from a cdn in Monox?  (Mono Support )

Viewed 34773 time(s), 6 post(s) 07.05.2012 13:43:41by Jeremy

Related topics

Jeremy

Jeremy

07.05.2012 13:43:41
Is there a setting in Monox for jQuery UI cascading style sheets (css) to be delivered by a content delivery network (cdn) like the javascript files?

I am looking for a setting that will add this:


These are the settings for the javascript in the web.config:

Dieser Inhalt wurde noch nicht bewertet. 
322 Reputation 36 Total posts
denis

denis

07.05.2012 15:41:16
There is no such config setting - however, if you call PageUtility.InjectJQuery method, it registers the jQuery UI js file by taking it from the web.config. The same method also tries to register the CSS with the same name from the same location (it replaces .min.js with .css), so there is no need for a separate setting.
If you need to do it manually, you can call a method HtmlFormatter.CreateCssLink and pass it the URL of your CSS file.
Bewertet mit 5,00, 1 Besucher. 
7207 Reputation 956 Total posts
Jeremy

Jeremy

08.05.2012 08:57:43
Unfortunately the automatic setting results in an incorrect link being added to my pages:
<link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.19/jquery-ui.css" rel="stylesheet" type="text/css" />

IE9 developer tools give a misleading error message "This stylesheet cannot be viewed because its source is in a different domain than the page." The file does not exist. Google gives a 404 error.

So I will have a look at the manual setting. Is there any way to stop the automatic css link from being added?
Dieser Inhalt wurde noch nicht bewertet. 
322 Reputation 36 Total posts
denis

denis

08.05.2012 12:27:16
By default, it is being applied only for admin users in the Main.master page. You cannot avoid it in this version, but you can manually register your own CSS URL.
Dieser Inhalt wurde noch nicht bewertet. 
7207 Reputation 956 Total posts
Jeremy

Jeremy

08.05.2012 21:45:16

Thank you for the clarification. I had been doing all my testing as admin. I can live with the incorrect link under those circumstances for the benefits of using a cdn. I have been able to successfully manually add the css using the method you described:

using MonoSoftware.Web;
 
    protected void Page_Load(object sender, EventArgs e)
    {
    }


Thank you.

Dieser Inhalt wurde noch nicht bewertet. 
322 Reputation 36 Total posts
khorvat

khorvat

08.05.2012 23:17:11
Hi,

we have logged in your suggestion / issue as a feature request so we will decide if this will be implemented in the next release.

Regards
Dieser Inhalt wurde noch nicht bewertet. 
15993 Reputation 2214 Total posts