I have a simple page that just checks a folder on my server for files and then populates the tree view with links to those files. All this works fine except when I click on the link that is created nothing happens. I notice the in the javascript that is created by the tree view that the link has an s before the http like this
javascript:__doPostBack('Treeffl','shttp://www.mywebsite.com/folder/video/jj/filename.avi')
I think this may be the problem, but I didn't write that code, I believe the tree view did.
Here is my code
VB CODE
Partial Class FFL05
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim aLocalFiles As IO.FileInfo() = (New IO.DirectoryInfo("c:\foldername\").GetFiles("*.*"))
For Each aFile As IO.FileInfo In aLocalFiles
Treeffl.Nodes.Add(New TreeNode("http://www.mywebsite.com/" + aFile.Name))
Next
End If
End Sub
-------------------------
ASPX Code
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="FFL05.aspx.vb" Inherits="FFL05" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body bgcolor="Gray">
<form id="form1" runat="server">
<div>
<asp:TreeView ID="Treeffl" runat="server">
</asp:TreeView>
</div>
</form>
</body></html>
---------------------------
Code generated when I do a view source from IE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><link href="App_Themes/Black/Default.css" type="text/css" rel="stylesheet" /><link href="App_Themes/Black/frame.css" type="text/css" rel="stylesheet" /><title>
Untitled Page
</title><style type="text/css">
.Treeffl_0 { text-decoration:none; }
</style></head>
<body bgcolor="Gray">
<form name="form1" method="post" action="ffl05.aspx" id="form1">
<div>
<input type="hidden" name="Treeffl_ExpandState" id="Treeffl_ExpandState" value="nnnnnnnnnnn" />
<input type="hidden" name="Treeffl_SelectedNode" id="Treeffl_SelectedNode" value="Treefflt9" />
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="Treeffl_PopulateLog" id="Treeffl_PopulateLog" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE5NDYyMjMzMDkPtrYCAgMPZBYCAgEPPCsACQIADxYGHg1OZXZlckV4cGFuZGVkZB4MU2VsZWN0ZWROb2RlBQlUcmVlZmZsdDkeCUxhc3RJbmRleAILZAgUKwAMBSwwOjAsMDoxLDA6MiwwOjMsMDo0LDA6NSwwOjYsMDo3LDA6OCwwOjksMDoxMBQrAAIWBB4EVGV4dAU9aHR0cDovL3d3dy5ncmFjZWJhcHRpc3Qtb2guY29tL2Jsb2cvdmlkZW8vZ3QvYXVzdGluaG9vcHMxLndtdh4IRXhwYW5kZWRnZBQrAAIWBB8DBTtodHRwOi8vd3d3LmdyYWNlYmFwdGlzdC1vaC5jb20vYmxvZy92aWRlby9ndC9DaXZpbFdhck1ULm1wMx8EZ2QUKwACFgQfAwU+aHR0cDovL3d3dy5ncmFjZWJhcHRpc3Qtb2guY29tL2Jsb2cvdmlkZW8vZ3QvRW1lcnNvbkJkYXkwNS53bXYfBGdkFCsAAhYEHwMFO2h0dHA6Ly93d3cuZ3JhY2ViYXB0aXN0LW9oLmNvbS9ibG9nL3ZpZGVvL2d0L2dtYXBhcnR5MDUud212HwRnZBQrAAIWBB8DBTdodHRwOi8vd3d3LmdyYWNlYmFwdGlzdC1vaC5jb20vYmxvZy92aWRlby9ndC9HdHNub3cud212HwRnZBQrAAIWBB8DBTxodHRwOi8vd3d3LmdyYWNlYmFwdGlzdC1vaC5jb20vYmxvZy92aWRlby9ndC9oYWxsaG9vcHMwNi53bXYfBGdkFCsAAhYEHwMFOmh0dHA6Ly93d3cuZ3JhY2ViYXB0aXN0LW9oLmNvbS9ibG9nL3ZpZGVvL2d0L2pvc2hob29wcy53bXYfBGdkFCsAAhYEHwMFOmh0dHA6Ly93d3cuZ3JhY2ViYXB0aXN0LW9oLmNvbS9ibG9nL3ZpZGVvL2d0L3RnaXZpbmcwNS53bXYfBGdkFCsAAhYEHwMFNmh0dHA6Ly93d3cuZ3JhY2ViYXB0aXN0LW9oLmNvbS9ibG9nL3ZpZGVvL2d0L1RodW1icy5kYh8EZ2QUKwACFgYfAwU2aHR0cDovL3d3dy5ncmFjZWJhcHRpc3Qtb2guY29tL2Jsb2cvdmlkZW8vZ3QvV29yazMud212HwRnHghTZWxlY3RlZGdkFCsAAhYGHwMFSmh0dHA6Ly93d3cuZ3JhY2ViYXB0aXN0LW9oLmNvbS9ibG9nL3ZpZGVvL2d0L19DYWJsZS0zMF8yMDA2MDMwNl8xNzI1MDcuYXZpHwRnHwVoZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFB1RyZWVmZmyvDiTFpgyfesbQqelRHOt9phOxdw==" />
</div>
<script type="text/javascript">
<!--
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
// -->
</script>
<script src="/blog/WebResource.axd?d=zT5UPTVomdHNXqvvArZaJQ2&t=6327577gt283870832" type="text/javascript"></script>
<script src="/blog/WebResource.axd?d=rg47ayeTZvv_O1v1vB_JkQ2&t=63275774gt83870832" type="text/javascript"></script>
<script>
<!--
function TreeView_PopulateNodeDoCallBack(context,param) {
WebForm_DoCallback(context.data.treeViewID,param,TreeView_ProcessNodeData,context,TreeView_ProcessNodeData,false);
}
// -->
</script>
<div>
<a href="#Treeffl_SkipLink"><img alt="Skip Navigation Links." src="/blog/WebResource.axd?d=5i_pmvP6pcH_35fSXiw7ZA2&t=6327577487283870832" width="0" height="0" style="border-width:0px;" /></a><div id="Treeffl">
<table cellpadding="0" cellspacing="0" style="border-width:0;">
<tr>
<td><img src="/blog/WebResource.axd?d=htrhV52Rl-7uCHRSarctWb1oXObOMSRMI6DsnLrO-mM1&t=632757740283870832" alt="" /></td><td style="white-space:nowrap;"><a class="Treeffl_0" href="javascript:__doPostBack('Treeffl','shttp://www.mywebsite.com/blog/video/folder/austinhoops1.wmv')" onclick="TreeView_SelectNode(Treeffl_Data, this,'Treefflt0');" id="Treefflt0">http://www.mywebsite.com/blog/video/folder/austinhoops1.wmv</a></td>
</tr>
</table><table cellpadding="0" cellspacing="0" style="border-width:0;">
<tr>
<td><img src="/blog/WebResource.axd?d=kg4hV52Rl-7uCHRSarctWb1oXObOMSRMI6DsnLrO-mM1&t=645757740283870832" alt="" /></td><td style="white-space:nowrap;"><a class="Treeffl_0" href="javascript:__doPostBack('Treeffl','shttp://www.mywebsite.com/blog/video/folder/CivilWarMT.mp3')" onclick="TreeView_SelectNode(Treeffl_Data, this,'Treefflt1');" id="Treefflt1">http://www.mywebsite.com/blog/video/folder/CivilWarMT.mp3</a></td>
</tr>
</table><table cellpadding="0" cellspacing="0" style="border-width:0;">
</div>
<script type="text/javascript">
<!--
var Treeffl_ImageArray = new Array('', '', '', '/blog/WebResource.axd?d=kg4hV52Rl-7uCHRSarctWffoXObOMSRMI6DsnLrO-mM1&t=632757740283870832', '/blog/WebResource.axd?d=kg4hV52Rl-7uCHRSarctWddJ7ctANeAj2XSmFGXu-ZI1&t=632757740283870832', '/blog/WebResource.axd?d=kg4hV52Rl-7uCHRSarctWcc1QsO5Jw7PCv9o_WOoT8w1&t=632757740283870832');
// -->
</script>
<div>
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wccDALumNDZDALJh+I9AqDRxd0JAsWnq8ILAumruPEDArfw+4oBAp2n0doPAoe/7tELAuPZ9IsLArTjwPkGAsz7mbYCAovg/o4FxzHZjc3PHmraCLBOt8Z+5+RCQ6k=" />
</div>
<script type="text/javascript">
<!--
WebForm_InitCallback();var Treeffl_Data = new Object();
Treeffl_Data.images = Treeffl_ImageArray;
Treeffl_Data.collapseToolTip = "Collapse {0}";
Treeffl_Data.expandToolTip = "Expand {0}";
Treeffl_Data.expandState = theForm.elements['Treeffl_ExpandState'];
Treeffl_Data.selectedNodeID = theForm.elements['Treeffl_SelectedNode'];
for (var i=0;i<6;i++) {
var preLoad = new Image();
if (Treeffl_ImageArray[i].lenfolderh > 0)
preLoad.src = Treeffl_ImageArray[i];
}
Treeffl_Data.lastIndex = 11;
Treeffl_Data.populateLog = theForm.elements['Treeffl_PopulateLog'];
Treeffl_Data.treeViewID = 'Treeffl';
Treeffl_Data.name = 'Treeffl_Data';
// -->
</script>
</form>
</body>
</html>