PageRenderTime 19ms CodeModel.GetById 17ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/themes/RazorHost/PostView.ascx

#
ASP.NET | 25 lines | 19 code | 6 blank | 0 comment | 1 complexity | 47cd13e128747579f89f325b76c8b0a5 MD5 | raw file
 1<%@ Control Language="C#" AutoEventWireup="true" EnableViewState="false" Inherits="BlogEngine.Core.Web.Controls.PostViewBase" %>
 2<%@ Import Namespace="BlogEngine.Core" %>
 3
 4<script runat="server">
 5
 6    protected override void OnLoad(EventArgs e)
 7    {
 8        base.OnLoad(e);
 9
10        ParseAndInjectRazor();
11    }
12
13    private void ParseAndInjectRazor()
14    {
15        string vPath = string.Format("~/themes/{0}/PostView.cshtml", BlogSettings.Instance.Theme);
16        string parsedRazor = RazorHelpers.ParseRazor(vPath, this);  // 'this' is PostViewBase.
17
18        if (!string.IsNullOrWhiteSpace(parsedRazor))
19        {
20            phContent.Controls.Add(new LiteralControl(parsedRazor));
21        }
22    }
23        
24</script>
25<asp:PlaceHolder ID="phContent" runat="server" EnableViewState="false"></asp:PlaceHolder>