Exemple #1
0
        public string ViewLink(string title = null, string cssClass = null, string fragment = null, string onClick = null)
        {
            string finalCssClass = cssClass;

            string finalUrl = Url;

            if (fragment != null)
            {
                finalUrl += "#" + fragment;
            }

            return(HtmlHelpers.LinkHtml(finalUrl, title ?? Title, finalCssClass, onClick));
        }
Exemple #2
0
        public string ViewLink(string title = null, string cssClass = null, string fragment = null)
        {
            string currentUrl    = UrlHelpers.CurrentUrl();
            string finalCssClass = cssClass;

            if (currentUrl == Url)
            {
                finalCssClass = (string.IsNullOrEmpty(cssClass) ? "" : (cssClass + " ")) + "selected";
            }

            string finalUrl = Url;

            if (fragment != null)
            {
                finalUrl += "#" + fragment;
            }

            return(HtmlHelpers.LinkHtml(finalUrl, title ?? Title, finalCssClass));
        }