Orsi Orsi - 3 months ago 16
CSS Question

Bootstrap not working in newly created page MVC C#

I need to send some mails from my website.
I've made a template, a cshtml page, I want to use bootstrap for styling. I use bootstrap in the whole project. But the problem is, the styling is not working.

I use this in some views and I put this in this template:

@model OnlineCarStore.Models.PurchaseVM
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
<script src="http://code.jquery.com/jquery.js"></script>

<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0-rc1/css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-glyphicons.css" type="text/css">

<script type="text/javascript" src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
<script type="text/javascript" src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
<script type="text/javascript" src="../../Scripts/jquery-1.8.2.min.js"></script>

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">

<p>Thanks for the order!</p>
<p>Details: </p>

<div class="container">
<div class="panel panel-default">
<div class="panel-heading">Order details</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-6">
<p>No: </p>
<div class="col-lg-6">
<p> @Model.Id</p>
<div class="col-lg-6">
<p>Date: </p>
<div class="col-lg-6">
<p> @Model.Date.ToShortDateString()</p>

In the other page the bootstrap is working well, the styling works. But in this page, the styling it's not working. All the details from order appears, but without any styling. It should appear like this:

enter image description here

enter image description here

Can you please advise what to, in order to make the bootstrap work in this page, too.


If styles in your sent email not work, write inline styles. Because when you send email only inline styles work.