ASP. NET MVC4+EF5+EasyUI+Unity2. Front end page framework construction and source code sharing of background management system injected by X

At the beginning, we have a series of solutions. Let's start to build a new system.

The user experience needs more and more attention. This time, we have left and right columns. On the left is the system menu, and on the right is a page collection composed of tabs pages. Each tab can be refreshed and closed separately, because they will be an iframe

If a worker wants to do well, he must sharpen his tools first. The following tools are required.

Visual Studio 2012

You can install mvc4 for VS2010 and develop with VS2010, but it seems that you will not be able to use EF5 0 will be ef4 Version 4, but it doesn't matter much.

The mvc4 will be mounted on the NET Framework4. 5 up.

OK!

Open the familiar vs and create an empty solution. I named it appsolution, and the class library namespace will start with app, such as app BLL,App. Web and other names. If you like cool friends, you can use your name

Such as joy BLL,Jason. BLL,zhangsan. Bll, whatever you want. Bll can also be used directly

We will create the project

1. MVC4. 0's app Admin Website Internet option, select razor view

Download easyui1.0 first 3.2: http://www.jeasyui.com/download/index.PHP

The maximum version is 1.3 4 we choose 1.3 2 because 1.3 Above 2 is jQuery 2.0

jquery2. 0 will not support IE8 If you have abandoned IE8, you can experience higher versions and smaller and faster JS libraries. (official he said so)

Delete unnecessary things, because we want some things and keep some. Copy easyUI to the corresponding directory. I like to separate scripts and styles.

1. JQuery easyui. Put min.js in the scripts directory

2. Put the theme themes under the content. I only keep the gray and blue themes here. Other themes have limited aesthetic. You can download new themes from the easyUI official website

3. Move the images folder to content

4. Delete the filters file

5. Put the materials in the content directory. I have prepared the picture materials for this project for you. If not enough, we can add them again

6. Set the accountcontroller of controllers cs,HomeController. CS delete

7. Delete the cshtml from the view view.

8. I deleted the script that is irrelevant or not compressed, because I don't think it is necessary to debug. In the future, when we encounter problems, we use other tools to assist debugging, such as httpanalyses software

All right, let's start building

Or create a new "empty" controller and add the index view

Index code

Here we see head@Styles.Render ("~ / content / CSS") these codes, which are the bundled compression technology of mvc4, compress and output CSS and JavaScript to the page. I've done it, so just look at it. You can also Google its principle composition. Many prawns in the blog Garden also give answers. Its file is app_ Bundleconfig. Under start cs

The script of index, the script of home view, integrates the right-click menu of tab page, and I have integrated it into the system. Before running, check the global Asax enable compression

In bundleconfig RegisterBundles(BundleTable.Bundles); Add before

//Enable compression bundletable EnableOptimizations = true; OK, let's see the effect!

If you want to enable gray themes, set @ styles Render("~/Content/themes/blue/css")

Change to @ styles Render ("~ / content / themes / gray / CSS")

In fact, there's nothing to say, just a simple framework for the system. If you don't use easyUI for less than a few hours, it's hard to build it, but don't worry, I've prepared the original code for you

Download the source code. Some students have problems running the app_ Bundleconfig. Under start CS change to

Author: ymnets source: http://ymnets.cnblogs.com/

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>