首页 > 代码库 > Events in ASP.NET Master and Content Pages

Events in ASP.NET Master and Content Pages

  1. Content page PreInit event.

  2. Master page controls Init event.

  3. Content controls Init event.

  4. Master page Init event.

protected void Page_Init(object sender, EventArgs e){       //do something      }

 

  1. Content page Init event.

  2. Content page Load event.

  3. Master page Load event.

  4. Master page controls Load event.

  5. Content page controls Load event.

  6. Content page PreRender event.

  7. Master page PreRender event.

  8. Master page controls PreRender event.

  9. Content page controls PreRender event.

  10. Master page controls Unload event.

  11. Content page controls Unload event.

  12. Master page Unload event.

  13. Content page Unload event.

public class PageHelper    {        public static string CurrentPageModuleId        {            get            {                return Convert.ToString(HttpContext.Current.Request.QueryString["mid"]);            }        }        public bool HasPagePermission()        {            if (string.IsNullOrEmpty(CurrentPageModuleId))                return false;            return HasPagePermission(CurrentPageModuleId);        }        public bool HasPagePermission(string moduleId)        {            return true;        }        public bool HasFunctionPermission(string moduleFunctionType)        {            if (string.IsNullOrEmpty(CurrentPageModuleId))                return false;            return HasFunctionPermission(CurrentPageModuleId, moduleFunctionType);        }        public bool HasFunctionPermission(string moduleId, string moduleFunctionType)        {            return true;        }    }
View Code