Also another problem arose. Seems like after setting h1.NavigateURL .NET system reformats the URL. As a result the final output HTML is different and it does not work in my case.... Here is more details:
1) NEW CODE (I just wrote)
private void DisplayURL(string text, string url)
{
// Create a new hyperlink object.
HyperLink h1 = new HyperLink();
// Assign some text and an ID so you can retrieve it later.
h1.Text = text;
//h1.ID = "newButton"; This is created dynamicly
h1.NavigateUrl = url;
// Add the button to a PlaceHolder.
PlaceHolder1.Controls.Add(h1);
PlaceHolder1.Controls.Add(new LiteralControl("<br>"));
}
2) NEW OUTPUT HTML:
<a href="J:\+LIZ\Daily%20reports\20060413\RF_error.log">J:\+LIZ\Daily reports\20060413\RF_error.log</a>
3) OLD CODE:
Response.Write("<a href='" + path2 + "'>" + path2 + "</a> </br>");
4) OLD OUTPUT HTML:
<a href='J:\+LIZ\Daily reports\20060413\RF_error.log'>J:\+LIZ\Daily reports\20060413\RF_error.log</a>
IF you compare the putputs, you will see that the control reformats the URL string, since the output URL actually points to the file, it does not work... Can I force the control not to format the string??? What else can I do to fix this problem?