ASP.NET - Treeview se construye de forma correcta pero al abrir uno de sus hijos me sale en blanco

 
Vista:

Treeview se construye de forma correcta pero al abrir uno de sus hijos me sale en blanco

Publicado por Treeview (1 intervención) el 11/02/2015 23:21:21
hola a todos, necesito ayuda urgente, tengo este codigo que lo que hace es construir un treeview desde los datos de la BD, todo bien hasta ahi pero haciendo un punto de interrupcion no comprendo porque cuando ya termino el metodo y se encuenta en end sub vuelve al metodo crearnodopadre y me borra la ruta de donde se encuentra el pdf motivo por el cual no lo puedo abrir, si me pudieran apoyar, gracias.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load



If Not Page.IsPostBack Then


Dim cad As String = Session("ss_CadenaConexionODBC")
Dim ne As New BL_FIWE.Negocio
Dim dt As New DataTable

dt = ne.listarfico(cad)

Dim str1 As String = String.Empty
If Not String.IsNullOrEmpty(Request.QueryString("Valor1")) Then
str1 = Request.QueryString("Valor1").ToString()
Label1.Text = Request.QueryString("Valor2")


Dim intId As Integer = CInt(str1)
Dim dt1 As New DataTable
dt = ne.elexidfico(cad, str1)

crearnodospadr(0, Nothing, dt)


End If




End If


End Sub


Public Sub crearnodospadr(ByVal indicePadre As Integer, ByVal nodepadre As TreeNode, ByVal datasestarbol As DataTable)
'Dim datasestarbol As New DataSet
Dim dataviewhijos As DataView


dataviewhijos = New DataView(datasestarbol)

dataviewhijos.RowFilter = "F06_idEleMenuPadre = " + indicePadre.ToString()


For Each datarowcurrent As DataRowView In dataviewhijos

Dim nuevonodo As New TreeNode
nuevonodo.Text = datarowcurrent("F06_NombreEleMenu").ToString().Trim()

If datarowcurrent("F06_tipo").ToString().Trim() = "2" Then
nuevonodo.ImageUrl = "imagenes/imagenpdf.JPG"
'nuevonodo.NavigateUrl = "imagenes/pdf/Directiva2030-005-2010-ContratacionyAdquisicionesdeBienesCorrientes.pdf"
nuevonodo.NavigateUrl = "imagenes/pdf/" + datarowcurrent("F06_ruta")

nuevonodo.Target = "_blank"

'Else
' nuevonodo.ImageUrl = "img/imagenpdf.JPG"
' 'nuevonodo.NavigateUrl = "img/ProyectoTesis GUEVARA_MBA URP.pdf"
End If


TreeView1.CollapseAll()


If nodepadre Is Nothing Then
TreeView1.Nodes.Add(nuevonodo)
Else
nodepadre.ChildNodes.Add(nuevonodo)
End If
crearnodospadr(Int32.Parse(datarowcurrent("F06_IdEleMenu").ToString()), nuevonodo, datasestarbol)


Next

End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder