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 )

36233 put(a) pogledan, 6 odgovor(a) 7.5.2012. 13:43:41Kreirao(la) Jeremy

Povezane teme

Jeremy

Jeremy

7.5.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:

Ovaj sadržaj još nije ocijenjen. 
322 Reputacija 36 Ukupno objava
denis

denis

7.5.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.
Ocjena 5,00, 1 glas(ova). 
7207 Reputacija 956 Ukupno objava
Jeremy

Jeremy

8.5.2012. 8: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?
Ovaj sadržaj još nije ocijenjen. 
322 Reputacija 36 Ukupno objava
denis

denis

8.5.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.
Ovaj sadržaj još nije ocijenjen. 
7207 Reputacija 956 Ukupno objava
Jeremy

Jeremy

8.5.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.

Ovaj sadržaj još nije ocijenjen. 
322 Reputacija 36 Ukupno objava
khorvat

khorvat

8.5.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
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava