[ASP. NET]: webform crud Pattern

Source: Internet
Author: User

 

Preface:

Almost all systems have the functions of adding, modifying, deleting, and querying data (crud ).
There are many implementation methods for writing crud in ASP. NET. For example, you can simply implement it using gridview.
This writing method binds the responsibility of crud to the control.
When we want to make changes, we can only select the method provided by the control or a special method to meet the customer's requirements.

 

This article describes a mode for writing crud.
Split crud responsibilities into one page. A single page is responsible for a single responsibility.
The cracked crud is not bound to a control but to a page. It can be easily modified to meet customer requirements.

 

Page process:

First, we can see the page flow chart used for the whole mode from the entire page flow.
There are six pages in total. Their responsibilities are as follows:
-List: displays the data list.
-Detail: displays a single data content.
-Insert: adds a new item.
-Update: update a piece of data.
-Delete: delete a piece of data.
-Y: Notification user result.

 

Page Description:

List:

Page requirement: none.
Page responsibilities: displays multiple data lists.
Page action:
1. Display single data: select single data to go to the detail page.
2. delete data: Select multiple data entries to go To the delete page.
3. Add information: Enter the insert page.

 

Detail:

Page requirement: single data.
Page responsibilities: display a single data content.
Page action:
1. modify data: Obtain and display a single data and go to the Update page.
2. delete data: Obtain and display a single data and go to the delete page.
3. Add information: Enter the insert page.

 

Insert:

Page requirement: none.
Page responsibility: enter a single data content.
Page action:
1. Add materials: Obtain the input single data, add it to the database, and go to the notify page.

 

Update:

Page requirement: single data.
Page responsibilities: Display and enter a single data content.
Page action:
1. modify data: obtain a single input data, modify it to the database, and go to the notify page.

 

Delete:

Page requirement: multiple documents.
Page responsibilities: displays multiple data contents.
Page action:
1. delete data: Obtain and display multiple pieces of data. Delete the data to the database and go to the notify page.

 

Notify:

Page requirement: Message content.
Page responsibility: displays the message content.
Page action:
1. Confirm the user: Go to the List page.

 

Implementation Instructions:

There are many ways to implement this mode.
-Create an ASP. NET page for each page.
-Create an ASP. Net user control for each page.
-Use ASP. net mvc to establish the system.
-... And so on.

 

When developing crud, there are also some functions such as data verification or Ajax, which are not described in detail.
When you wait for the actual operation, add it according to the selected method.

 

Postscript:

This mode mainly disperses crud responsibilities and establishes a loose operation process.
To use the mode to develop the system, most crud functions should be satisfied.

Related Article

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.