string BuildLink (string arg, string text, Color foreColor, bool hasLink)
{
StringBuilder str = new StringBuilder ();
Color clr;
hasLink = (Page != null && hasLink == true) ? true : false;
if (hasLink) {
str.Append ("<a href=\"");
#if NET_2_0
str.Append (Page.ClientScript.GetPostBackClientHyperlink (this, arg, true));
#else
str.Append (Page.ClientScript.GetPostBackClientHyperlink (this, arg));
#endif
str.Append ('\"');
if (!foreColor.IsEmpty) {
clr = foreColor;
} else {
if (ForeColor.IsEmpty)
clr = Color.Black;
else
clr = ForeColor;
}
str.Append (" style=\"color:" + ColorTranslator.ToHtml (clr));
str.Append ("\">");
str.Append (text);
str.Append ("</a>");
}
else
str.Append (text);
return str.ToString ();
}