Turn URL's into hyperlinks in ASP.NET(madskristensen.dk)

submitted by madskristensenmadskristensen(8565) 5 years, 11 months ago

Today, I needed a function that would look through some text input and check for any URL's and the URL's should then be turned into hyperlinks. In other words, I had to turn this www.someurl.com into <a href="http://www.someurl.com" target="_blank">www.someurl.com</a>. It should also be able to handle URL's that starts with http:\\ and not just www.

2 comments |category: |Views: 17

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by gavinjoycegavinjoyce(25.7k) 5 years, 11 months ago 0

I will be doing something similar with the comments on www.dotnetkicks.com. As you can see, currently only plain text is allowed.

Reply

posted by madskristensenmadskristensen(8565) 5 years, 11 months ago 0

That's great. Not even WordPress or other blog/CMS engines does this automatically. You have to write something like [url]http:\\www.url.com[/url]. That's just annoying.

Reply

information Login or create an account to comment on this story