I want to use this function [url][/url] when posting a link in my guestbook, the code is not working fully, thats why I want you to help me out with the last bit. Thanks
As an example, when I want to post a link I save [url]http://www.asp.net[/url] this in the database. Then when the guestbook is getting it from the database I want it to replace it to a link.
But something is wrong with the code.....can you help please.
RS("post").Replace("[url","<a target=""_blank"" href=").Replace("[/url","</a").Replace("]",">")
I'm not sure why you are using url and /url - -
why don't you save the base url in the database and build the link from the db dynamically
(not knowing where or how you're adding the link on the page)
Then, use a something like:
<a href='<%# Container.Dataitem("dbLinkField")'><%# Container.Dataitem("dbLinkField")</a>
ASPNet101.com - where to look first!
Control Grouper - easily control properties for multiple controls with one control!
Calendar Express - The Best HTML Calendar Generator on the web!
(Please 'Mark as Answer' when it applies)