DEFAULT.ASPX

zhaozj2021-02-16  147

DEFAULT.ASPX1, which reflects the principle of code and form separation. 2, independent of the user control independently of the form element

The Default page gives personalized information by finding cookies when initialization. Private void Page_load (Object Sender, System.Eventargs E) {

// Customize welcome message if personalization cookie is present if (! Request.Cookies [ "IBuySpy_FullName"] = null) {WelcomeMsg.Text = "Welcome" Request.Cookies [ "IBuySpy_FullName"] Value;.}} Here is the use of Request technology.

Page_init, the difference between Page_Load is that only the individual controls are loaded only in Page_Load. Although we can access controls in page_init events, but ViewState will not be loaded, so the controls still maintain their default, that is, after Postback, each control is still those default values.

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

New Post(0)