Created one MVC solution called "MvcWebRole". In this area I created a folder named "Content" to store my css files - asp.net-mvc

I want to access "Css" files from my application folder structure.
I have given like this
<pre>
<code>
<link rel='stylesheet' id='spoton-style-css' href="~MvcWebRole/Content/wp-content/plugins/cloudidx-layout-option/assets/css/spoton-stylea560.css?ver=3.9.1" type='text/css' media='all'
But "Css" reference was not taking from project folder.
Can any one can help me on this.

Try this :
<link rel='stylesheet' id='spoton-style-css' href="#Url.Content("~/Content/wp-content/plugins/cloudidx-layout-option/assets/css/spoton-stylea560.css")" type='text/css' media='all' />

Related

PNG files not found in ASAR

I have an Electron (1.7.10) application that is reporting it can't find 5 of 7 PNG files in my ASAR. All 7 PNGs are in the same folder, and 2 of them are displayed on screen fine. The other 5 report net::ERR_FILE_NOT_FOUND.
All src attributes for the img tags are dynamically generated and use relative paths (assets/images/MyImage.png). If I extract the ASAR, I can see the files in there, in the correct folder (as referenced by the src attribute).
If I use the console to set the location of my browser to one of the images (document.location.href = "file:///path/to/app.asar/dist/assets/images/MyImage.png") I get the same results - 2 of 7 show OK.
Before packaging my application (with electron-builder), all images show correctly.
Let me guess, you are building a react SPA using react-router, and BrowserRouter?
If so, use HashRouter instead. Electron does not work with SPA's route by default, because a SPA route changes, but the resource path is always relative to index.html.
I haven't evaluated the other answers, but for my particular case, an extremely solution worked. I don't believe this is well documented, so it might be fairly common for people to still encounter this issue. For my particulars, the relevant problem and solution were identified here.
To address, add <base href='./' /> to the index.html (or whatever your starting html file is that hosts your SPA). This is a complete example of mine:
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="./" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<meta
http-equiv="Content-Security-Policy"
content="script-src 'Self' 'unsafe-inline';"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>
const path = require('path');
path.join(__dirname, 'assets/images/MyImage.png');

Thymeleaf's <th> not working at runtime

I am trying to run this links with thymeleaf but it doesnt work
, the static version with th: runs fine but when using jetty and trying to get thesame css files at run time it does not work
<link rel="stylesheet"
href="../../resources/static/css/font-awesome.min.css"
th:href="#{/resources/static/css/font-awesome.min.css}">
<link rel="stylesheet"
href="../../resources/static/css/bootstrap.css"
th:href="#{/resources/static/css/bootstrap.css}">
If you're accessing your app from http://localhost:8080, try removing the absolute path.
See if this works:
<link rel="stylesheet"
th:href="#{/resources/static/css/font-awesome.min.css}"
href="/css/font-awesome.min.css" />
<link rel="stylesheet"
th:href="#{/resources/static/css/bootstrap.css}"
href="/css/bootstrap.css" />
Also, try to access you css on the browser URL to see if it shows its content:
http://localhost:8080/css/font-awesome.min.css
or
http://localhost:8080/css/bootstrap.css
Hope it's somehow useful.

How can I save 'favicon.ico' in radiant

I have not found a specific area to save the favicon.ico so I sending him to the area of assets.
But I can not get it back again.
This is in fact not related to Radiant at all.
As with any Rails application, you should just put your favicon.ico in the public/ folder.
Update: Ok.. if you múst use the backend to set the favicon, you could just do this in your layout:
<link rel="shortcut icon" href="<r:asset id="your asset's id"><r:link/></r:asset>" type="image/x-icon" />
.. or just 'hard code' the path to the asset you uploaded:
<link rel="shortcut icon" href="/assets/your asset's id/favicon.ico" type="image/x-icon" />

How to add media type to stylesheet reference asp mvc

I'm using asp mvc, and I'm using the following code to generate the CSS html reference:
#Styles.Render("~/Content/css")
which generates the following html:
<link href="/Content/site.css" rel="stylesheet"/>
and that works fine. However, I need to add media type as an additional attribute. How can I go about using this style.render to add attributes to the generated html? Should I be thinking about making the change in the bundle config instead?
edit: I would like the end product to look like this:
<link href="/Content/site.css" rel="stylesheet" media="handheld"/>
You should be using #Styles.RenderFormat() for that:
#Styles.RenderFormat(#"<link href=""{0}""
rel=""stylesheet""
media=""handheld"" />",
"~/Content/css")
Try this
< link href="#Styles.Url("~/Content/css")" rel="stylesheet" type="text/css" media="handheld" />

how to link css file at html page

i have some script..it lies in some direktori :
var/www/html/dataTables-1.6/media/css/demo_page.css
how to put in html page?
<link href=......??? rel="stylesheet" type="text/css" media="all">
Assuming html is your webroot, place the following in your head tag.
<link href="/dataTables-1.6/media/css/demo_page.css" rel="stylesheet" type="text/css" media="all">
Is this what you were asking?
You could use the full server path "/location/of/the/file/here.css" or you could use the relative path from where the file you are placing it in resides. "../back/one/directory.css". Or you could use the full web URL for it "http://www.yourhost/yourwebRoot/yourfile.css".

Resources