Beispiel #1
0
        public static MvcHtmlString RenderNavigationBar(this HtmlHelper html)
        {
            var urlHelper = new UrlHelper(html.ViewContext.RequestContext);

            var user = UserOnline.GetUserDataFromCookie(System.Web.HttpContext.Current.Request);

            StringBuilder sb = new StringBuilder();

            sb.Append("<ul class=\"nav navbar-top-links navbar-right\">");
            sb.Append("<li class=\"dropdown\">");
            sb.Append("<a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">");
            sb.Append("<i class=\"icon-user\"></i>&nbsp; " + user.Username + ", " + user.FullName + "<span class=\"text-required\"> " + ConfigurationManager.AppSettings["ApplicationTitle"].ToString() + "</span> &nbsp;<i class=\"fa fa-caret-down\"></i>");
            sb.Append("</a>");
            sb.Append("<ul class=\"dropdown-menu dropdown-user\">");
            sb.Append("<li><a href=\"" + urlHelper.Action("LogOut", "Main", new { area = string.Empty }) + "\"><i class=\"icon-power\"></i>&nbsp; Logout</a></li>");
            sb.Append("</ul>");
            sb.Append("</li>");
            sb.Append("</ul>");

            return(new MvcHtmlString(sb.ToString()));
        }