Пример #1
0
        /// <summary>
        /// Creates the raw handler instance without any exception handling
        /// </summary>
        /// <param name="pageUrl"></param>
        /// <returns></returns>
        internal static IHttpHandler CreateHandler(string pageUrl)
        {
            IHttpHandler page;

//            HttpContext ctx = HttpContext.Current;
//#if NET_1_1
//                string physicalPath = ctx.Server.MapPath(pageUrl);
//				s_log.Debug(string.Format("constructing page virtual path '{0}' from physical file '{1}'", pageUrl, physicalPath));
//              page = PageParser.GetCompiledPageInstance(pageUrl, physicalPath, ctx);
//#else
//            string rootedVPath = WebUtils.CombineVirtualPaths( ctx.Request.CurrentExecutionFilePath, pageUrl );
//            if (s_log.IsDebugEnabled)
//            {
//                s_log.Debug( "page vpath is " + rootedVPath );
//            }
//
//            page = BuildManager.CreateInstanceFromVirtualPath( rootedVPath, typeof( IHttpHandler ) ) as IHttpHandler;
//#endif
            page = VirtualEnvironment.CreateInstanceFromVirtualPath(pageUrl, typeof(IHttpHandler)) as IHttpHandler;
            return(page);
        }
Пример #2
0
 /// <summary>
 /// Creates the raw handler instance without any exception handling
 /// </summary>
 /// <param name="pageUrl"></param>
 /// <returns></returns>
 internal static IHttpHandler CreateHandler(string pageUrl)
 {
     return(VirtualEnvironment.CreateInstanceFromVirtualPath(pageUrl, typeof(IHttpHandler)) as IHttpHandler);
 }