Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referencing Bootstrap.css
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01618452
Message ID:
01618656
Vues:
40
If you're using WebForms ~/content/... is not expanded. AFAIK, ~ expansion only works with Razor. So you need to change that to:
<link href="<%= ResolveUrl("~/content/bootstrap/css/bootstrap.min.css") % rel="stylesheet" type="text/css"/>  
You may also have to wrap that into a PlaceHolder control. If I remember right script tags are not allowed in the header directly.

Alternately you can reference bootstrap from a CDN which is not a bad idea anyway:
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
http://www.bootstrapcdn.com/

+++ Rick ---

>I am testing my ASP.NET web application on customer server.
>
>I am having a little issue referencing Bootstrap.css. Here is how it is referenced in my Site.Master:
>
>
><link href="~/content/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>  
>
>
>The following URL in the browser works (that is, Bootstrap is working):
>
>http://localhost:8070/MobileApp/Login.aspx
>
>
>But when I change the URL as follows:
>
>http://ServerName:8070/MobileApp/Login.aspx
>
>
>The Bootstrap does not work (the layout is all messed up).
>
>The structure of the application is as following (in inetpub\www)
>
>MainAppSite/MobileWeb
>
>
>MainAppSite is the site where main application reside. MobileWeb is sub-folder where Virtual application reside. The MobileWeb Virtual application should work completely independently of the MainAppSite. And it works with the "Localhost" but not with the server name.
>
>What is wrong with how I reference the Bootstrap.css (above)?
>
>TIA
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform