Connect ExtJS with. NET Development example (grid data display, paging, sorting the article), on this basis to achieve the bulk deletion function.
The following steps are implemented:
1. Implement the deletion function with WebService (the article has a garden friends to put forward to use WebService to realize, here by the way, take the data source can also use WebService, we can refer to the deletion of the webservice to achieve their own, I here is not tired of the statement)
Create a new WebService file named: Deleteproject.asmx
The code is as follows:
DeleteProject.asmx.cs
1using System;
2using System.Data;
3using System.Linq;
4using system.web;
5using System.Collections;
6using System.Web.Services;
7using System.Web.Services.Protocols;
8using System.ComponentModel;
9using System.Xml.Linq;
10using businessobject.projects; References to DBML files
11using Database;
12namespace Web.Projects.OperProjects
13{
/**////<summary>
///Summary description for Deleteproject
///</summary>
[WebService (Namespace = "http://tempuri.org/")]
[WebServiceBinding (ConformsTo = wsiprofiles.basicprofile1_1)]
[ToolboxItem (False)]
The//To allow this Web Service to is called from script, using ASP.net AJAX, uncomment the following line.
//[System.Web.Script.Services.ScriptService]
public class DeleteProject:System.Web.Services.WebService
23 {
24
[WebMethod]
Num public bool Delproject (string strprojects)//Here need to return the deletion succeeded to the ExtJS call
27 {
BOOL result = FALSE;
Try
30 {
Projectbaseinfodatacontext db = new Projectbaseinfodatacontext ();
The var projects = from P in db. Project_base_infos
where Strprojects.indexof (p.project_no) > 0
Select P;
Db. Project_base_infos.deleteallonsubmit (projects);
result = true;
37}
The catch {
result = false;
40}
41
return to result;
43}
44}
45}
46