コード例 #1
0
        private string LayoutOutput(string path)
        {
            var pathDefinition = new PathDefinition()
            {
                IsWildcard   = true,
                VirtualPath  = UrlPath.ResolveUrl("~/" + LayoutVirtualFileResolver.ResolverPath),
                ResolverName = typeof(LayoutVirtualFileResolver).FullName
            };

            //// Do not use the VirtualPathProvider chain. It may cause unexpected behavior on concurrent requests.
            string result;
            var    resolver = new LayoutVirtualFileResolver();

            using (var streamReader = new StreamReader(resolver.Open(pathDefinition, path)))
            {
                result = streamReader.ReadToEnd();
            }

            return(result);
        }
コード例 #2
0
ファイル: MvcMasterPage.cs プロジェクト: RifasRazick/feather
        private string LayoutOutput(string path)
        {
            var pathDefinition = new PathDefinition()
            {
                IsWildcard = true,
                VirtualPath = UrlPath.ResolveUrl("~/" + LayoutVirtualFileResolver.ResolverPath),
                ResolverName = typeof(LayoutVirtualFileResolver).FullName
            };

            //// Do not use the VirtualPathProvider chain. It may cause unexpected behavior on concurrent requests.
            string result;
            var resolver = new LayoutVirtualFileResolver();
            using (var streamReader = new StreamReader(resolver.Open(pathDefinition, path)))
            {
                result = streamReader.ReadToEnd();
            }

            return result;
        }