Jmocke
Jmocke

Reputation: 271

Bootstrap with asp.net forms

I am using bootstrap in my asp.net form application. I have all the required files in the project:

When I add a content page in the root directory , the site work perfectly; all the bootstrap features work correctly. But the problem is, when I place content in another folder (eg. webapp/content/default.aspx), the site does not work in IE. On other browsers it displays the content but the features of bootstrap don't work at all.

My scripts:

<script src="js/jquery-2.0.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>

Upvotes: 1

Views: 255

Answers (3)

arame3333
arame3333

Reputation: 10213

JQuery 2.0.x is not compatable with some of the older browsers. Use the latest 1.9.x

See http://www.sitepoint.com/jquery-2-support-ie6-ie7-ie8/

Upvotes: 1

Leo
Leo

Reputation: 1505

You need a / as in

<script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/bootstrap.min.js"></script>

To be more complete

  1. starting with a slash makes it relative to the root website directory
  2. Two periods ../ would make it go up one directory (so ../../ makes it go up two directories ...)
  3. ~/ takes you to the root of your project directory.
  4. otherwise it is relative to the directory the current file is in. (so js/jquery-2.0.3.min.js is looking for the file in a js subfolder of your current dir.)

Upvotes: 0

gabrielhws
gabrielhws

Reputation: 333

**Try using the files:**
ie8-responsive-file-warning.js,
html5shiv.js and 
respond.min.js.

Make the Downloads and place the files in js folder.

**Use the paths**

    "@Url.Content("~/patch/file.js")"



     ****Example****


    <head>
        <!-- Just for debugging purposes. Don't actually copy this line! -->
        <!--[if lt IE 9]><script src="@Url.Content("~/js/ie8-responsive-file-warning.js")"></script><![endif]-->

        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="@Url.Content("~/js/html5shiv.js")"></script>
          <script src="@Url.Content("~/js/respond.min.js")"></script>
        <![endif]-->

        <script src="@Url.Content("~/js/jquery-2.0.3.min.js")"></script>
        <script src="@Url.Content("~/js/bootstrap.min.js")"></script>

      </head>

Upvotes: 0

Related Questions