QUOTE(lldietrich @ 1 Jul, 2008 - 08:00 AM)

Hi Kitt,
I wanted to let you know that I got your code to work, the only problem is: the links don't go to the right path.
I added the path to where the screenshots would be like this:
CODE
sb = sb.Append("<a href=../Documents/ScreenShots/"+ s3 + " >" + s3 + "</a><br />");
When running in debug mode, it lists the correct files as filling s3, but when the page displays and I click on the links, the path returns: C:/Test/Documents/ScreenShots/" and if there is another file, that one has the same path except instead of a double quote, it has the first word in the file.
What I need to be able to do is display the links in another window. If it was HTML I know I could use _blank, but I am not sure how to do it in C#.
Thanks for all your help. I hope you can give me some insight as to why I am not getting the full path to the files.
~Lori
Hey Lori,
First off, you *are* generating html here, so you are right that target="_blank" is the way to open the links in another window. I see that I typed 'htmls code' and if that is the source of your confusion I am sorry. It was just a typo, I meant 'html code'.
So if you want this to open in a new window just add that like so...
CODE
sb = sb.Append("<a href=\"" + s3 + "\" target=\"_blank\" >" + s3 + "</a><br />");
On to your problem with the path/filename not working out right:
I use the backslash character to generate a quote inside the string so that the link will look like this:
<a href="fred.doc" target="_blank">fred.doc</a>
instead of this:
<a href=fred.doc target=_blank>fred.doc</a>
That is the way I personally like my html code to look, but I think yours will execute just as well...
Anyway, I suppose it is possible that the quote is coming from a \" that is left in your code or something...
I think I would suggest examining sb in debug mode and maybe you can see what is going on. Or you could break this into two steps with a string s4, like so and examine what is happening in both s4 and sb...
CODE
foreach (string s3 in s2)
{
string s4 = "<a href=\"" + s3 + "\" >" + s3 + "</a><br />";
sb = sb.Append(s4);
}
If you are still having a hard time finding the issue post a little more of your code and I will take a look at it.
It looks like you are just about there.
Good luck,