NavigateURL problem
-
Hi, I have a very strange problem. The navigateURL is changing on browser. So, when I debug the value of url i.e. is: E:\Documents\www.txt but in the browser it shows me: file:///E:/Documents/www.txt as you noticed, it changes my backslashes and becouse of that the url is not working. Does anybody know why? and how can I change it? my code is here:
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e) { TreeView1.Nodes[0].Value = @"E:\asem\Visual Studio 2005\WebSites\SDP\users\" + Membership.GetUser().UserName.ToString(); addsubdir(TreeView1.SelectedNode.Value); } void addsubdir(string path) { DirectoryInfo dr = new DirectoryInfo(path); if (dr.Exists) { foreach (DirectoryInfo d in dr.GetDirectories()) { TreeNode t = new TreeNode(); t.Value = d.FullName; t.Text = d.Name; t.NavigateUrl = ""; TreeView1.SelectedNode.ChildNodes.Add(t); } foreach (FileInfo file in dr.GetFiles()) { TreeNode t = new TreeNode(); t.Value = file.FullName; t.Text = file.Name; **string url = file.FullName; t.NavigateUrl = url; //it is changing right here Label1.Text = url;** TreeView1.SelectedNode.ChildNodes.Add(t); } } }