I'm using VS 2012 SP3 in which i have an ASP.NET web site. In my "Default.aspx" i have the following link
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" runat="server" rel="stylesheet" />
Whenever i use the design view to for my page like inserting a new row in table in changes it to
<link href="http://localhost:50309/netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" runat="server" rel="stylesheet" />
Which is becoming pretty annoying.
Does anyone have any idea about how to disable this feature ?
I would also like to note that I have Productivity Power Tools 2012 installed Web Essentials 2012 (but i've disabled them both and still not luck Thanks!
Update 1: Steps to reproduce
Create a new .aspx page
Paste
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" />
between the head tags.Go to split view
Write some text between the divs
The href changes to
<link href="http://localhost:50309/netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" />
(port may vary :D)
Update 2: Microsoft Bug Report Connect Link
The VS designer is picky about URI formats in a link tag, and it will "fix" any href that it does not approve of. The result is not always helpful.
In your case, the issue is that your href is missing a scheme name. VS should stop rewriting your href if you change your link tag like this:
Side Note: After you fix the href, the designer may complain that it can't edit the style sheet. I don't know why it does that with this particular file, and I have not seen it do this with other CSS. Just ignore the warning, and the style sheet should be applied correctly.
When using the ASP.NET Script Bundles, you can provide the CDN locations where your script library can be found. When you also add the code locally you get the benefit of being able to debug against the non-minified version while the CDN version will be used when the site runs in production.
See the following documentation on setting up script bundles on ASP.NET Web Forms.
basically you need to add a couple of lines to the Global.asax:
And then create your bundle as follows:
And reference it like this:
This should please both the browser and the editor.
You can also configure the
<scriptmanager>
to automatically fall back to the CDN using the following pieces of code:And this configuration:
Read the following blog by Scott Hanselman for more details.