I know that I can use normal html files in ASP.NET MVC; however I have a situation where several (above 20) html files are needed for static display. This is fine and good, but I really don't want it cluttering the MVC project since none of them will have controller actions.
Is there any way to load up a second project and use static html files from it, within ASP.NET MVC?
I know my answer is not directly related to your question as you are asking how to access HTML pages from a second project. But an alternate would be to place the html files in your content directory. This way you could catalog your static html pages
For Instance:
MVC Directory Structure
Content
images
logo.png
script
utility.js
staticHtml
static.html
static2.html
Model
Views
Related
I'm developing a new Hugo site and in this case I thought to create also a template so.I can use for future site.
Well in the template there are tons of vendor files and library because depending of the pages that the site will implement these library will be used. The problem is on the deploy. For example I use Line icons library that has a lot of .png files. (For example 200 files).
Well in the template I put all the files but could happen that in the site that implement this template I use only five icons. Is there a way that look around the final HTML and the usage of the icons and delete in the public folder the not necessary files?
Not directly.
You would need to add an utility script to your template, in order for any user implementing said template to be able to call this script on demand.
That script should then be able to:
analyze the HTML files generated in public_html
cleanup the icons accordingly
I am using Bootstrap for some basic styling to a CRUD app in Sinatra. While the assets in the public folder load as usual on all pages, they don't load when I am browsing a particular record in my database.
For example, http://localhost:4567/songs loads all stylesheets and assets, but not http://localhost:4567/songs/1.
In my console, the page seems to be trying to find the css file in /songs folder, which I am not sure why its doing that.
http://localhost:4567/songs/bootstrap.css
Any help or pointers would be appreciated.
My main.rb file: http://pastie.org/8543319
My song.rb class file: http://pastie.org/8543312
Provide absolute path for assets in your views.
I am developing an application for a client where a requirement is that a series of complex (multi-file, JS, CSS, etc), websites must be presented offline, without any web connection required at all.
So I have all of the HTML content folders, and can add them into my XCode project... but now I need to show them.
The UIWebView is fine when you just have one HTML file... but the relative paths for the JS and CSS do not translate over.
What is the best way to do this. I've seen a couple of potential choices. One way is to run a super basic web server locally, dump all the files into /documents (or thereabouts) and serve it from there... the second is to somehow make UIWebView re-interpret the paths so that they point to the right place locally... which I am not sure if it's possible but I've seen it alluded to.
Seems like a lot of people just cover loading a single UIWebView page, and not so much discussing how to deal with CSS/JS dependencies.
Anyone have any bright ideas, links, etc?
Thanks
I think that if you add your HTML/CSS/JS tree to your Xcode project and select "Create folder references for any added folder" (instead of "Recursively create groups for any added folders"), then your bundle will contain the HTML/CSS/JS folder hierarchy (instead of the flattened-out list of all files). This would preserve relative paths.
As to the "reinterpreting" point, you can define
– webView:shouldStartLoadWithRequest:navigationType:
in your UIWebViewDelegate to intercept any attempt at loading any file. There you can change the url on the fly.
Also, have a look at this interesting article by Rob Napier: Drop-in offline caching for UIWebView.
Anybody ever integrated MCImageManager and Zend Framework? I want to use MCImageManager in standalone mode (not as part of TinyMCE). I'm really at a loss here - don't know where to put any of the files. Do I need to create a view helper that somehow references the main index.php file of MCImageManager?
I think I figured it out. I just added the whole imagemanager directory to my public directory. That way I can just treat it like any other static files (images, css, js, etc).
I want to create a down for maintenance page in asp.net mvc so whatever the request is it will point it to Home/Down
What router configs I need to set in global.cs file?
You could use an App_Offline.htm file. Simply upload an html file with this name to the route of your ASP.NET application and all requests will route to it. When you are ready to put your site back online simply delete the file. There's a small gotcha you should be aware of when using App_Offline.htm file with an ASP.NET MVC application.