The display layer is usually made up by .aspx / .aspx.cs file, used to display the data page, the page layer should be the method logic layer in the logical layer directly call the logical layer is an intermediate layer, used to connect the page Layers and data layers, it is necessary to provide interfaces to the page layer. At the same time, it is also necessary to call the method from the data layer to use the data layer to be the best. Generally, the data is operated. This three-layer system is explained. Try it. Page layer [default.aspx]: only one DataGrid control and the final result of the Label control page
DEFAULT.ASPX.CS file
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 Lemongtree.bl; Namespace Services {///
#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);} ///
Private void DataGrid1_pageIndexchanged (Object Source, System.Web.ui.WebControls.DataGridPageChangedeventArgs E) {}}}
Logic layer [bl.cs]
using System; using System.Text; using System.Data; using System.Data.SqlClient; using LemongTree.DB; using System.Web.UI.WebControls; namespace LemongTree.BL {///