Visual Studio - Could not edit because it is not in the website
I have a link to some style sheet from the Yahoo Developer Network, this is what I have in the head section of my master page:
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.0r4/build/reset/reset-min.css&2.8.0r4/build/base/base-min.css" media="all" />
And for some reason Visual Studio (2008 Professiona开发者_如何转开发l) keeps telling me:
"could not edit 'http://yui.yahooapis.com/combo?2.8.0r4/build/reset/reset-min.css&2.8.0r4/build/base/base-min.css' because it is not in the website".
My head tag has a runat="server" attribute so I can't have any code in there to inject the url.
Has anyone managed to get rid of this very useful message?
Though a definitive solution hasn't been found, a Microsoft guy in this ASP.NET Forums thread is asking for projects that exhibit this issue.
The proposed solutions that may work for you, but haven't worked for me, include:
- Ensure your CSS file has uniform line endings. Edit menu > Format Document in Visual Studio. Of course, this is hard when the file is on a Yahoo server.
- Install Visual Studio 2008 SP1.
- Open Visual Studio first, then open the solution file. (Don't open the solution file directly by double-clicking in Windows Explorer.)
Can you create a local copy of the stylesheet? Just during development, then switch it back to online source once you're ready for production?
I was having this same issue in referencing the following style sheet, so I wrapped in a Response.Write, after that, the annoying message box stopped appearing.
<% Response.Write( @"<link rel=""stylesheet"" href=""http://static.jquery.com/ui/css/base2.css"" type=""text/css"" media=""all"" />" ); %>
I had also tried rel="stylesheet nofollow", but IE doesn't like that and will not render properly. The above works fine for FireFox and IE.
精彩评论