How to use Free CSS Templates with ASP.NET MVC 4? - asp.net-mvc-4

I need to use a css template for webpage I am building but I don't know how to use in asp.net mvc4. so How to use CSS Templates with ASP.NET MVC 4 in visual studio 2012 for web application?

It's simple:
Move your css and images into ~/Contents folder.
Move your js files into ~/Scripts folder
Copy and paste your html snippets to cshtml files
On 3rd step you need to port the layout portion of your template to ~/Veiws/Shared/_Layout.cshtml. Here you need to point references to your css and js correctly. For example:
And also you need to be aware that _Layout.cshtml should contain #RenderBody(). That's where all child views will be inserted.
Just found a video with basic demonstration of process: link

It is the same as you use for simpe HTML files. In the solution you can add an existing item and your browse your CSS file which will be added in the Content folder then you have to reference it in the page where it will be used.
If you want to apply all the rules to every page you can reference it in the _Layout.cshtml page which is called before everypage. It is like the container.
You have many options to call it. I will suggest you also reading Bundling and minification in this link which is also interesting to know.

There are Few Steps:
Make Directory inside Content folder in my case mytemplate.
Copy all your template content inside mytemplate folder.
Add new Layout page in View>Shared Folder in my case _mytemplate.cshtml.
open your template Index.html file inside any editor(i.e: Dreamviewer,Notepad etc).
Copy all header stuff from your html file to inside of Header in _mytemplate.cshtml file.
Copy all body stuff Inside of your Index.cshtml to Layout page.
Save your Project by Cntrl+S and Run it in browser. Thats it.

Related

Combine all my custom JS into one single file with dojo build

I'm having a hard time trying to set up dojo build in my project.
Basically, I have my js folder with all my custom widgets and components. I simply want to combine all javascript files form js folder into one single file.
dojo sources are located outside this folder. The structure looks similar to this:
/public
/prod
/dojo-1.9
/dijit
/dojo
/dojox
/js
myScript1.js
myScript2.js
Do you have any idea on how should I configure the package.json and profile.js? The documentation doesn't seem to help since all I am getting is an output folder with the same contents as the js folder (no javascript is merged).
You can start by reading this article:
https://dojotoolkit.org/reference-guide/1.10/build/simpleExample.html
It provides a simplified overview of dojo build system.
Additional there is dojo boilerplate with a sample of folder structure and profile.js configuration for quick start here:
https://github.com/csnover/dojo-boilerplate
I definitely suggest you to use the boilerplate as start for your project as it simplify a lot initial configurations.

How to include jQuery from Global Libraries into my page in Intellij IDEA?

I cannot understand what is the advantages of having jQuery in "Global Libraries" list?
Can I somehow include any javascript Global Library into my html page or should I just copy/paste content of this library to new file in my project and include it manually to html page?
Global libraries are needed for code completion in the web applications when there are no explicit includes in all the pages or when you are editing JS files that have access to other libraries, but there is no way to specify it directly in the script.
Of course you need to have a copy of the library in your project or reference its URL in HTML pages.

how to set directories js for javascript files, ui for interfaces and css directory for style in web.xml

I want to set web.xml for my first project. For managing project easily i want to arrange files in folders according to their extension in Web Content folder.
Anything wrong with just putting them in exactly those folders?
someapp/js/myscript.js
someapp/css/mystyles.css

Changing Inside Assets Folder In Yii Framework

I came to notice that there is one folder called assets in the root folder.To know more about it,I went through this link.Now I want to know adding some css in these files is good or shall I add css to to the main.css file inside css folder.
The asset folder is automatically generated by Yii based upon your environment so best avoid putting your CSS, images etc inside here. It also best to not commit these folders and files into SVN as they are automatically generated and folder names will differ from your qa/staging/live site to your local site.
There are some good reasons to use Yii's assets.
it prevents naming conflicts in css and js files
it allows you to keep CSS and JS files under your document-root but outside of your web-root (for easier version control)
it allows to easily switch between sets of CSS & JS files, rather than having to deal with each file individually (suppose the system admin needs to revert back to a previous version).
it allows you to publish assets (images, JS & CS) to several websites hosted on the same server.
Please check here or there for more details.
Well, when i started my first Yii project, i also put my CSS and JS files in assets. It works but then i found that its not just the right way. Its better to make a separate directory for your CSS file(s). Also there are some auto generated files in assets, so to avoid mix-up with those and your i prefer to make it separate. Hope you got the point.

Howto modify Sandcastle presentation style without changing the default installation files

My project uses Sandcastle and Sandcastle Help File Builder to generate documentation.
We're using a customized version of script_manifold.js that persists the user's language preference across pages (the default version resets the language preference with each page).
Currently, the script is located in the Sandcastle\presentation\VS2005\scripts folder.
Is there a way to override this script with a custom version, without having to mess with the Sandcastle installation? That is, can I have a file that is checked into source control along with my source code, and somehow have that file used by SHFB instead of the default Sandcastle one?
Never mind, I found the answer!
In the SHFB project explorer window, you can just create a folder with the same name as the presentation style content you wish to override. This works with any stock content, such as HTML, CSS or JS files. So in my situation, I needed to override the script_manifold.js file which lives in the Scripts folder of the VS2005 presentation style.
So I needed to create a folder called Scripts in my SHFB project, then put my script_manifold.js in that folder.
It all works perfectly. Excellent!