Learn the MVC rental website (vii)-listing management and map uploading

Source: Internet
Author: User

In the previous < study on the MVC Rental website (vi)-User login and Rights control > completed the background user login and permission control function development, the next thing is to complete the management of the property, users in the background to add, edit listings information for the front-end user operation.

One listing management

1 listing display and deletion is more general, but there are some areas to be aware of afterwards

A) about paging, because many places will be used, so packaged for uniform use.

In order to ensure that the output Html text can be rendered correctly, using the @html.raw () method, the paging information is passed from the controller using ViewBag, although viewbag is a dynamic type, it is still appropriate to pass the paging information.

b) The error page will also be used in multiple places, placed in the Shear folder, and by the calling controller pass the error page to be specific display, but note that there are two of the view of the overload

The error view displays the contents of the model, but if the string type is passed directly, it is recognized on the second overload, so it is forced to be converted to an object.

c) In bulk Delete, to use JS to get all the selected ID, Internet search has a variety of methods, here is var formData = $ (' #formList '). Serializearray ();

2 New and edited in the business related to furniture, housing status, decoration situation, type and other information, involving more service, there will be a lot of drop-down options, this information to be passed to the Get view ViewModel.

A) drop-down box directly with HtmlHelper to provide @html.dropdownlist more convenient, can directly solve the problem is very tempting.

b) Check-in time to use the date selection control, here my97datepicker. Before the company has a place of date control is not good, remember someone mentioned change My97datepicker. This is recorded in the code for later reference.

Two picture operations

1 image upload

Housing information must not be the details of the house every aspect of the picture, need to meet the needs of users to upload pictures. Use Webuploader plug-in, the effect is also very good, support the mainstream batch upload, drag upload and other operations.

2 Picture Delete

After the image is uploaded, the picture is stored on the server disk, and the disk path of the picture is stored in the database, and the next view listings information loads the picture from the disk. However, the policy used to delete pictures here is to delete only the picture path information of the database, and still keep the picture files on the disk.

Note:

The content of the course to free Peng Network (www.rupeng.com), focusing on college students employment online education platform;

ASP. NET MVC course http://www.rupeng.com/News/9/640.shtml

Learn the MVC rental website (vii)-listing management and map uploading

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.