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

 

Events in ASP.NET Master and Content Pages,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。