Chapter 4 Write an ASP.NET page

xiaoxiao2021-03-06  40

The event order asp.net in the page is based on an event, although the code in these events is processed in turn, but only when the event is generated. × Page_INIT Runs the event when the page is initialized × page_load When the page is loaded, the event is triggered if a control (such as a button) triggers the page to reload, raise the event × page_unload When the page is from memory The difference between this event is initiated when the event is unloaded is that only the various controls are fully loaded in Page_NIT, which does not load ViewState Revitalization (Postback) authentication Page ISPOSTBACK attributes, solve the page_load in each page The code running when loading, because it allows us to identify yourself is in a return state or loading the page status for the first time. Page.ispostback = false The first load, = true indicates that the return status sub page_load ... 'parameter omitted if page.ispostback = false kil connString = "..." ..... ..... myDataGrid.datasource = ds.tables ("tabel"). DefaultView mydataGrid.dataBind End IF This means that only the first load page is running the grid data binding.

Page class ------------------------

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

New Post(0)