ASP. NET MVC5 website development practice (2) Member region & ndash; manage list, reply and delete

Source: Internet
Author: User

I was thinking about writing this article last time. I didn't expect that some of my work would have fallen, so I had to make up for it after the holiday.

Directory:

ASP. NET MVC5 website development practices-Overview

ASP. NET MVC5 website development practices (I)-project framework

ASP. NET MVC5 website development practices (I)-framework (continued) model, data storage, and business logic

ASP. NET MVC5 website development practices (2)-user part (1) User Registration

ASP. NET MVC5 website development practices (2)-user part (2) User logon and Cancellation

ASP. NET MVC5 website development practices (2)-user section (3) modify materials and passwords

ASP. NET MVC5 website development practices (2) Member region-Article Management Architecture

ASP. NET MVC5 website development practices (2) add an article in The Member Area

ASP. NET MVC5 website development practices (2) Member region-list of all articles

ASP. NET MVC5 website development practices (2) Member region-Modify and delete Articles

ASP. NET MVC5 website development practices (2) Member region-consulting and Management Architecture

ASP. NET MVC5 website development practices (2) Member region-my consulting list and add Consulting

 

I. Management list

Similar to my list, I directly pasted the code.

First, open the Consultation controller and add the ManageList method.

                           

Add ManageJsonList for the returned json data

 JsonResult ManageJsonList( pageIndex = ,  pageSize =  _list = commonModelService.FindPageList( _total, pageIndex, pageSize, , .Empty, , .Empty, , , => ========== Json( { total = _total, rows =

 

Right-click ManageList and add an attempt

= <Div id => <div> <a href = data-options = onclick => Delete </a> <a href = data-options = onclick => refresh </a> </div> <table id => </table> <script src => </script> <script type =>, title:, checkbox:, title:, title:, align:, title:, align:, formatter: function (value, row, index) {, title:, width :, align: detail = $ (). datagrid (, index ). find (ReplyConsultation + row. modelID + ). datagrid (</script>

ManageList adds the usage class framework of the datagrid detailed view (ReplyConsultation + row. ModelID + ). "Consultation/Reply" is the view we Reply.

In the Consultation controller, add the Reply Method

                                     ActionResult Reply(

 

Right-click to add view

@ Html. displayNameFor (model => model. name) @ Html. displayFor (model => model. name) @ Html. displayNameFor (model => model. isPublic) @ Html. displayFor (model => model. isPublic) @ Html. displayNameFor (model => model. QQ) @ Html. displayFor (model => model. QQ) @ Html. displayNameFor (model => model. email) @ Html. displayFor (model => model. email) @ Html. displayNameFor (model => model. content) @ Html. displayFor (model => model. content) Administrator: @ Model. replyTime:

Add the receiving method.

=  (RouteData.Values.ContainsKey( _modelId = .Parse(RouteData.Values[= (.IsNullOrEmpty(Request.Form[])) ModelState.AddModelError(, = Request.Form[== 

The process is:

1. The id parameter (RouteData. Values. ContainsKey (

, Set other parameters (ReplyTime, Status) and save it to the database

ActionResult Delete (_ commonModel =) Json (commonModelService. Delete (_ commonModel) Json (

Open the ManageList view and add or delete js Code.

Rows = $ ("# Consultation_List"). datagrid ("getSelections "(! Rows | rows. length <1 "prompt", "no row selected! "(Rows. length> 0" OK "," Are you sure you want to delete the selected row? "," Post "" @ Url. Action ("Delete", "Consultation") "'close' rows. length = 0" # Consultation_List "). datagrid ('reload'

 

Iv. Summary

This time the content is repeated. The management list is similar to my consulting list. The deletion and reply operations are similar to the article code. Finally, write it to the background management area next time.

========================================================== =

Code http://pan.baidu.com/s/1bn07Igf

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.