Argentini.Halide.H3Text.MakeLink C# (CSharp) Method

MakeLink() public static method

style link, based on passed parameters. ]]>
public static MakeLink ( string strVal, string url, string title, string target, string className ) : String
strVal string Text to make into a link (text to wrap with anchor tags).
url string URL to which the link should point.
title string Text for the "title" and "alt" properties of the anchor tag.
target string Destination for the "target" property of the anchor tag.
className string Class name with which to style the anchor tag.
return String
        public static String MakeLink(string strVal, string url, string title, string target, string className)
        {
            string returnVal;

            if(FixNull(strVal).Length > 0 && FixNull(url).Length > 0)
            {
                returnVal =  "<a href=\"" + url + "\"";

                if (target.Length > 0) {
                    returnVal += " target=\"" + target + "\"";
                }

                if (className.Length > 0) {
                    returnVal += " class=\"" + className + "\"";
                }

                if (title.Length > 0) {
                    returnVal += " alt=\"" + title + "\" title=\"" + title + "\"";
                }

                returnVal += ">" + strVal + "</a>";

                return(returnVal);
            }
            else
            {
                return (string.Empty);
            }
        }

Same methods

H3Text::MakeLink ( string strVal, string url ) : String
H3Text::MakeLink ( string strVal, string url, string title ) : String