/BlogEngine/BlogEngine.NET/themes/RazorHost/PostView.ascx
ASP.NET | 25 lines | 19 code | 6 blank | 0 comment | 1 complexity | 47cd13e128747579f89f325b76c8b0a5 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
- <%@ Control Language="C#" AutoEventWireup="true" EnableViewState="false" Inherits="BlogEngine.Core.Web.Controls.PostViewBase" %>
- <%@ Import Namespace="BlogEngine.Core" %>
-
- <script runat="server">
-
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
-
- ParseAndInjectRazor();
- }
-
- private void ParseAndInjectRazor()
- {
- string vPath = string.Format("~/themes/{0}/PostView.cshtml", BlogSettings.Instance.Theme);
- string parsedRazor = RazorHelpers.ParseRazor(vPath, this); // 'this' is PostViewBase.
-
- if (!string.IsNullOrWhiteSpace(parsedRazor))
- {
- phContent.Controls.Add(new LiteralControl(parsedRazor));
- }
- }
-
- </script>
- <asp:PlaceHolder ID="phContent" runat="server" EnableViewState="false"></asp:PlaceHolder>