Using XSL to implement the ordering operation of the client

xiaoxiao2021-03-06  40

There are now many web programs, there are many features that are sorted and paging. When you do this, we have to go to the server to go to the server. Here I use the XSL XML way to demonstrate, only the data is taken from the server, and the client can be used, and the client can perform the operation you want. // The main function of this file is to remove the data from the database. Then converted into XML, transmitted to the client using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI Using system.Web.ui.webcontrols; using system.web.ui.htmlcontrols; using system.data.sqlclient; using system.xml; Namespace C3 {///

/// WebForm9 summary description. /// public class WebForm9: System.Web.UI.Page {private void Page_Load (object sender, System.EventArgs e) {SqlConnection cn = new SqlConnection (); cn.ConnectionString = "server = .; uid = sa; pwd =; database = northwind "; cn.Open (); SqlCommand cmd = new SqlCommand (); cmd.Connection = cn; cmd.CommandText =" select EmployeeID, LastName, Title, BirthDate from employees "; DataSet ds = New Dataset ("EMPS"); SqlDataAdapter Da = New SqldataAdapter (); da.selectcommand = cmd; da.fill (DS, "EMP"); cn.close (); response.clear (); this.Response. ContentType = "text / xml"; // this.response.contentencoding = "gb2312"; this.response.write (""); This.Response.write (DS.GETXML ​​()); response.end ();

#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} ///

/// Designer Supports the required method - Do not use the code editor to modify the // / this method. /// private () {this.load = new system.Eventhandler (this.page_load);} #ENDREGON}} // The main function of this file is to obtain data from the server. Then dynamically generate XSL implementation sort. <% @ Page language = "c #" codebehind = "Webform8.aspx.cs" autoeventwireup = "false" inherits = "c3.webform8"%>

Webform8