PageRenderTime 58ms CodeModel.GetById 25ms 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
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. <%@ Control Language="C#" AutoEventWireup="true" EnableViewState="false" Inherits="BlogEngine.Core.Web.Controls.PostViewBase" %>
  2. <%@ Import Namespace="BlogEngine.Core" %>
  3. <script runat="server">
  4. protected override void OnLoad(EventArgs e)
  5. {
  6. base.OnLoad(e);
  7. ParseAndInjectRazor();
  8. }
  9. private void ParseAndInjectRazor()
  10. {
  11. string vPath = string.Format("~/themes/{0}/PostView.cshtml", BlogSettings.Instance.Theme);
  12. string parsedRazor = RazorHelpers.ParseRazor(vPath, this); // 'this' is PostViewBase.
  13. if (!string.IsNullOrWhiteSpace(parsedRazor))
  14. {
  15. phContent.Controls.Add(new LiteralControl(parsedRazor));
  16. }
  17. }
  18. </script>
  19. <asp:PlaceHolder ID="phContent" runat="server" EnableViewState="false"></asp:PlaceHolder>