Ok, so I recently had an SEO audit done on my site and per the recommendations I added the Geo.txt, robots.txt, Schema.txt and sitemap.xml files to my root directory (not sure exactly if this is where these files go...) And now for some reason my page displays like there is no CSS file at all. Could adding one of these files affect that? Do I need to add the path to my CSS to one of the files? I will add my header section below.
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-L6BBJ36NQR"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-L6BBJ36NQR');
</script>
<asp:ContentPlaceHolder ID="contentHead" runat="server">
</asp:ContentPlaceHolder>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="keywords" content="Web Development Erie PA Application Custom Software Northwest PA" />
<link rel="manifest" href="site.webmanifest" />
<link rel="shortcut icon" type="image/x-icon" href="assets/img/favicon.ico" />
<!-- CSS here -->
<link href="" rel="stylesheet" />
<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
<link rel="stylesheet" href="assets/css/owl.carousel.min.css" />
<link rel="stylesheet" href="assets/css/slicknav.css" />
<link rel="stylesheet" href="assets/css/flaticon.css" />
<link rel="stylesheet" href="assets/css/progressbar_barfiller.css" />
<link rel="stylesheet" href="assets/css/gijgo.css" />
<link rel="stylesheet" href="assets/css/animate.min.css" />
<link rel="stylesheet" href="assets/css/animated-headline.css" />
<link rel="stylesheet" href="assets/css/magnific-popup.css" />
<link rel="stylesheet" href="assets/css/themify-icons.css" />
<link rel="stylesheet" href="assets/css/slick.css" />
<link rel="stylesheet" href="assets/css/nice-select.css" />
<link rel="stylesheet" href="assets/css/style.css" />
</head>
The page is supposed to look like this:
Proper site look
But instead it looks like this:
Wrong site look
Related
When I want to use a variable in a link (parameter) all js files throw console errors
When I remove the parameter from the link everything works fine
Page:
#page "/PollShow/{id:int}"
#code{
[Parameter]
public int Id { get; set; } = 1;
}
this is my _host.cshtml
#page "/"
#namespace Polls.Pages
#addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
#{
Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>SB Admin 2 - Dashboard</title>
<link href="~/css/sb-admin-2.css" rel="stylesheet" />
<link href="~/css/StyleSheet.css" rel="stylesheet" type="text/css" />
<!-- Custom fonts for this template-->
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
<!-- Custom styles for this template-->
<link href="css/sb-admin-2.min.css" rel="stylesheet">
<!-- Custom styles for this page -->
<link href="vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">
</head>
<body id="page-top">
<component type="typeof(App)" render-mode="ServerPrerendered" />
<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for all pages-->
<script src="js/sb-admin-2.min.js"></script>
<!-- Page level custom scripts -->
<script src="js/demo/datatables-demo.js"></script>
<script src="~/_framework/blazor.server.js"></script>
</body>
</html>
error console when i use link with parameter
enter image description here
You'll need to use the exacte same name for the parameter. Its case sensitive
#page "/PollShow/{Id:int}"
I'm new to web development but have some experience with C#, so I'm trying my luck with ASP.NET.
I was able to create the base app and so on, however now I want to use my own CSS stylesheet.
I tried using the exact syntax that the base app uses:
<head runat="server">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>#ViewData["Title"] - SmtteProject</title>
<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
</environment>
<environment exclude="Development">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
crossorigin="anonymous"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"/>
</environment>
<link rel="stylesheet" href="~/css/test.css"/>
<link rel="stylesheet" href="~/css/site.css" />
</head>
Where the test.css is the stylesheet I want to use. It is in the exact same directory as site.css, however I get this error in the console on the page:
GET http://localhost:5000/css/test.css net::ERR_ABORTED 404 (Not Found)
I tried using runat="server" in both the head and in the link, as I saw quite a few answers online with this solution. However, that did not do the trick either.
I tried displaying an image that was in an images directory in the exact same way, but encountered the same issue.
Any help welcome.
It's Cascading Style Sheets, or CSS. Not CCS. I think that this naming confusion is the root of your problem.
Your file is named test.ccs. It should be named test.css, per the HTML snippet you provided.
I was trying to add kendo Map, i added necessary css and script files but i am not getting #(Html.Kendo().Map() i am getting all other widgets like splitter ,slider ,grid but no Map.
What would be the reason any guess?
Added files and dll shown below
<link href="~/Content/kendo.common.min.css" rel="stylesheet" />
<link href="~/Content/kendo.default.min.css" rel="stylesheet" />
<link href="~/Content/kendo.dataviz.default.min.css" rel="stylesheet" />
<link href="~/Content/kendo.default.min.css" rel="stylesheet" />
<script src="~/Scripts/jquery.min.js"></script>
<script src="~/Scripts/kendo.all.min.js"></script>
<script src="~/Scripts/kendo.aspnetmvc.min.js"></script>
#using Kendo.Mvc.UI;
EDIT
It seems Map is not supported in kendo or some .js sequence i am missing or something overriding?
I would like to replace http://www.somewebsite.com programmaticaly when page loads.
Is it possible to do?
<head runat="server">
<title></title>
<link href="http://www.somewebsite.com/App_Themes/Blue/StyleSheet.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="www.somewebsite.com/inc/styles_ie.css" />
<![endif]-->
<link href="http://www.somewebsite.com/App_Themes/RedBlack/StyleSheet.css" type="text/css" rel="stylesheet" />
</head>
Here I found a really good example how to do it http://www.codeproject.com/Tips/523983/Adding-Styles-Dynamically-to-ASP-NET-Page-Header
Literal cssFile = new Literal()
{
Text = #"<link href=""" + Page.ResolveUrl(styleFilePath) +
#""" type=""text/css"" rel=""stylesheet""/>"
};
Page.Header.Controls.Add(cssFile);
I am trying to open a jQueryMobile datebox in a dialog mode. I am trying to set the datebox to a default value but it just won't take it for some reason. Here is my code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>#PageData["Title"]</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<link rel="stylesheet" type="text/css" href="http://dev.jtsage.com/cdn/datebox/latest/jquery.mobile.datebox.min.css" />
<link rel="stylesheet" href="#Href("/Styles/theme/mysite.min.css")" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
<script src="http://dev.jtsage.com/cdn/datebox/latest/jquery.mobile.datebox.min.js"></script>
<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/i8n/jquery.mobile.datebox.i8n.en.js"></script>
</head>
<body>
<script type="text/javascript">
$('document').ready(function(){
//Setting start date value on pageload
$('#myqdate').value('2012-01-14');
$('#myqdate').datebox('refresh');
}
</script>
<form name="shiftform" id="shiftform" action="#Href("~/Account/QChanges.cshtml")" method="post">
<div data-role="fieldcontain">
<label for="myqdate">Date:</label>
<input name="myqdate" id="myqdate" type="date" value="" data-role="datebox" data-options='{"mode": "flipbox", "forceInheritTheme": true, "defaultDate":"2012-01-14"}'>
</div>
<input type="submit" value="Get Queue"/>
</form>
</body>
</html>
I would really appreciate help from experts.
Thanks
This should do it:
$('#myqdate').trigger('datebox', {'method':'set', 'value':'2012-01-14', 'date':new Date('2012-01-14')})
It seems that you should be using the "defaultValue" property instead of the "defaultDate" that is in the data-options of your posted code. No need for the script block.
try closing your function:
$('document').ready(function(){
//Setting start date value on pageload
$('#myqdate').value('2012-01-14');
$('#myqdate').datebox('refresh');
}
)};