How can I write this code so that it will appear as just "Click here" but
encoded with the link information?
strFile = "Click here";
row["Link"] = "<a href="http://www.ibm.com>" + strFile + "</a>";
Thanks!
Peter Duniho - 12 Oct 2007 08:30 GMT
> How can I write this code so that it will appear as just "Click here" but
> encoded with the link information?
>
> strFile = "Click here";
> row["Link"] = "<a href="http://www.ibm.com>" + strFile + "</a>";
What are you having trouble with?
If you want a string with double-quotes in it, you need to "escape" the
double-quotes by preceding the double-quote character with a backslash.
Otherwise, it should be just like writing the regular HTML as you'd see
it in a web page.
Pete
Enkidu - 12 Oct 2007 10:46 GMT
> How can I write this code so that it will appear as just "Click here" but
> encoded with the link information?
[quoted text clipped - 3 lines]
>
> Thanks!
Try
row["Link"] = "<a href=\"http://www.ibm.com\">" + strFile + "</a>";
Cheers,
Cliff

Signature
Have you ever noticed that if something is advertised as 'amusing' or
'hilarious', it usually isn't?
Jeff Jarrell - 12 Oct 2007 15:53 GMT
Aside from escaping the quote ' \" '
I find String.Format() can provide an easier to read syntax.
row["Link"] = String.Format("<a
href={0}http://www.ibm.com{0}>{1}","\'",strFile)
> How can I write this code so that it will appear as just "Click here" but
> encoded with the link information?
[quoted text clipped - 3 lines]
>
> Thanks!