"Original" Bootstrap+knockout.js+asp.net Mvc3+petapoco for CRUD operations

Source: Internet
Author: User

1. Demand:

1.1) the page to be beautiful atmosphere

1.2) front-end code to be concise and clear, to use MVC or the MVVM framework

1.3) The server needs to use the MVC framework, to rest style

1.4) data access to use ORM

2. Effect:

2.1) List

2.2) Paging

2.3) New

2.4) Modify

3. Technical considerations:

3.1) Taking into account the beautiful atmosphere of the page, in the absence of art, Bootstrap is indeed a good choice

3.2) The front-end frame chooses the knockout.js of MVVM, presumably because Microsoft has this framework in its own project template, so it has always liked it.

3.3) ASP. NET MVC is now out to 5, all kinds of mature, I use the VS2010, handy with a 3

3.4) Entity framework too heavy, nhibernate do not seem to update it, a variety of micro-ORM used up, contrast dapper, massive, Petapoco seems more simple and convenient some

4, Knockout.js's understanding:

Take a look at teacher Artech's diagram and understand the flow of data and the process of processing it.

5, the framework of the construction:

No brain operation, a variety of front-end libraries, back-end libraries so put it OK

6, some technical points:

6.1) Modification of the route:

I only use the personnel number (PersonID) to pass between pages, so I modified the parameter "{Controller}/{action}/{personid}" in Routes.maproute in the Global.asax file, So the place I'm using to receive this rest-style parameter is defined as PersonID and can be received

6.2) Use of paging controls:

To match the bootstrap framework, the pagination control also uses the bootstrap-style control (jqpaginator), which modifies the code slightly.

Paging well, no matter what you want to know the current page of data, a total of several pages, which page is currently a few key content, the back end using Petapoco this micro ORM framework, directly can get the page<t> type of data collection, and then peel off the package.

The front-end setting of the corresponding property to receive the data thrown from the backend is fine.

The back end of the page data to KO's Observer object

Other direct-to-page paging controls are good to use.

When the paging control click, the corresponding search controller, pass the delivery page value is finished.

: Http://pan.baidu.com/s/1ntsj4MX

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.