views:

158

answers:

2
<link href="http://www.../default.css" rel="stylesheet" type="text/css" />

Could not edit 'http://...' because it is not in the Web site.

I get this error box every five minutes, how do I get it to stop telling me this?

+2  A: 

Well, seems like it's because you're including an href that points to a URL, instead of a relative web path.

Instead of

<link href="http://www.mysite.com/styles/default.css" rel="stylesheet" type="text/css"/>

use

<link href="/styles/default.css" rel="stylesheet" type="text/css"/>

Also, make sure your closing

/>

is valid in terms of your Doctype.

David Lively
I'd like to keep it the way it is and just get rid of that constant error message. o_0 Is that possible?
rlb.usa
+1  A: 
<link runat="server" id="defaultCss" rel="stylesheet" type="text/css"/>

and on your code behind

defaultCss.attributes.add("href","http://www..../default.css");

if your css is in your website then you can use

ResolveUrl("~/default.css")

to get the url

or probably best practice is to add it to your app theme folder http://msdn.microsoft.com/en-us/library/ykzx33wh.aspx and then not only will it be automatically added but you'll get intellisense

Stephen lacy
defaultCss.Attributes.Add("href","http://www..../default.css"); // works (Case Sensitive)
rlb.usa