PageRenderTime 21ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/admin/admin.master.cs

#
C# | 63 lines | 33 code | 9 blank | 21 comment | 1 complexity | 5b65797b2a6020d81b5adee6f76db6b4 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  1. // --------------------------------------------------------------------------------------------------------------------
  2. // <summary>
  3. // The AdminMasterPage.
  4. // </summary>
  5. // --------------------------------------------------------------------------------------------------------------------
  6. namespace Admin
  7. {
  8. using System;
  9. using System.Threading;
  10. using System.Web.UI;
  11. using BlogEngine.Core;
  12. /// <summary>
  13. /// The AdminMasterPage.
  14. /// </summary>
  15. public partial class AdminMasterPage : MasterPage
  16. {
  17. #region Public Methods
  18. /// <summary>
  19. /// Sets the status.
  20. /// </summary>
  21. /// <param name="status">
  22. /// The status.
  23. /// </param>
  24. /// <param name="msg">
  25. /// The message.
  26. /// </param>
  27. public void SetStatus(string status, string msg)
  28. {
  29. this.AdminStatus.Attributes.Clear();
  30. this.AdminStatus.Attributes.Add("class", status);
  31. this.AdminStatus.InnerHtml =
  32. string.Format(
  33. "{0}<a href=\"javascript:HideStatus()\" style=\"width:20px;float:right\">X</a>",
  34. this.Server.HtmlEncode(msg));
  35. }
  36. #endregion
  37. #region Methods
  38. /// <summary>
  39. /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
  40. /// </summary>
  41. /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
  42. protected override void OnInit(EventArgs e)
  43. {
  44. if (!Security.IsAuthenticated)
  45. {
  46. Security.RedirectForUnauthorizedRequest();
  47. return;
  48. }
  49. Page.Header.DataBind();
  50. base.OnInit(e);
  51. }
  52. #endregion
  53. }
  54. }