Link to home
Start Free TrialLog in
Avatar of Rad1
Rad1

asked on

Adding " target=_blank" to a String.Format ASP.NET

Hi,

I need to add " target=_blank" to the below code to make the link open in a new page.
Any idea how to add it?

Thank you!!!



 private static readonly string link = "<a href=\"{0}{1}\">{2}</a>";

 if (!match.Value.Contains("://"))
                {
                    body = body.Replace(match.Value, string.Format(link, "http://", match.Value, ShortenUrl(match.Value, 500)));
                }
                else
                {
                    body = body.Replace(match.Value, string.Format(link, string.Empty, match.Value, ShortenUrl(match.Value, 500)));
                }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rad1
Rad1

ASKER

Excellent!!!!

Thank you!