Checkout.aspx and Page

zhaozj2021-02-16  157

It's funny, the original background is this: background = "images / sitebkgrd.gif" Table Art: This page is a table with countless table

As a checkout page, its purpose is to put all the product information and then confirm. So it has DataGrid and Summit. DataGrid is like this and the database is connected: According to the reason, in fact, he even is just a function GetItems () return value. MyDataGrid.DataSource = Cart.getItems (CARTID); (This function returns a DataReader) myDataGrid.database ();

In the middle of this page, ABC.ABC is an event, and ABC_ABC is an event handler.

Page_init method (Event Processor) can respond to the init event. Using the init event can create a control at runtime and add them to the page (Page_Load method is used to perform the initialization of the control at runtime). Events can also be implemented in a programming manner with init events. Void Page_init (Object Sender, EVENARGS E) {EqualsButton.click = New EventHandler (onadd);} This is VS. NET is used to connect events and event handler technology.

What kind of element contains some elements in Checkout.aspx (or: Checkout) page? (1), Checkout () Constructor (2), Page_Load (Object Sender, System.EventArgs E) Used to perform the initialization of the control at runtime (3), Submitbtn_Click (Object Sender, System.Web.ui.ImageClicKeventargs E) (4) Page_init (Object Sender, Eventargs E).

I understand, (1) CHECKOUT () The role is to link the page.init (4) page_init (4) page_init (4) (2) and (3) these two EventHandler Links with their event this.load and this.submitbtn.click.

On the checkout.aspx page: Private void Page_init (Object sender, Eventargs e) {/// codegen: this call is required by the asp.net web form designer. // initializecomponent ();}

#REGION Web Form Designer generated code ///

/// Required Method for Designer Support - Do Not Modify /// The Contents of this Method with the code editor. ///

private void InitializeComponent () {this.SubmitBtn.Click = new System.Web.UI.ImageClickEventHandler (this.SubmitBtn_Click); this.Load = new System.EventHandler (this.Page_Load);} #endregion

Page_init The two EventHandler of Page_Load and Submitbtn_Click are associated with their event this.load and this.submitbtn.click.

Let's take a look at Submitbtn_Click, there are three ids inside, for CARTID, CUSTOMERID, ORDERID, and pay attention to what is the relationship between them. ORDERID = ORDERSDATABASE.PLACEORDER (Customerid, CARTID);

It should be noted that only registered users can enter this page, but the code does not verify the code of the user, how is it implemented, make sure that only registered users can enter? The verification method used in this program is: Forms-based security, using WebConfig settings to ensure that only authentication users can enter.

转载请注明原文地址:https://www.9cbs.com/read-8986.html

New Post(0)