Example #1
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event to initialize the page.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data.</param>
        protected override void OnInit(EventArgs e)
        {
            registeredWithPageViewHost = true;
            PageViewHost.Register(this, Context, AutoDataBind);

            base.OnInit(e);
        }
Example #2
0
        internal static PageViewHost FindViewHost(Control control, HttpContext httpContext, ITraceContext traceContext)
        {
            traceContext.Write(typeof(PageViewHost), () => "Finding PageViewHost instance.");

            var pageContext = control.Page.Items;

            if (pageContext.Contains(ViewHostCacheKey))
            {
                return((PageViewHost)pageContext[ViewHostCacheKey]);
            }

            var host = new PageViewHost(control.Page, control, httpContext);

            pageContext[ViewHostCacheKey] = host;

            return(host);
        }