Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to populate an iframe with specific pdf documents. I have a treeview which is populated from a database, one of the records in the database has a form_name field. It has a reference code to pdf's. eg: 'xxxx.pdf' when i click on the the node I want to send the pdf to an iFrame which I have in a page PDFViewer.aspx I have hard coded one of the pdf's and manage to view it in the iFrame. Now I want the page load code behind to enable me to point to a specific folder which stores all the pdf's. I have looked at this for too long now and can't see how to achieve it. I'm also pretty new to VB.
Thanks in advance to anyone who can help.


This is where I populate the node. I have reference to the pdf's sought by their 'FORM_NAME'. When I click on the node I want to be sent to the 'PDFViewer.aspx' page and see the relevant pdf based on the selection.

VB
Sub PopulateMenuLevel2(ByVal node As TreeNode)
     Dim sqlQuery As New OracleCommand
     SQLText.Text = sqlQuery.ToString()
     SQLText.Text = sqlQuery.CommandText.ToString()

     sqlQuery.CommandText = "SELECT MENU_DESC_2, MENU_NO_2, FORM_NAME FROM MENU_LEVEL_2 " & " Where MENU_NO_0 = :menuno0 AND  MENU_NO_1 = :menuno1"
     sqlQuery.Parameters.Add(New OracleParameter("menuno1", node.Value))
     sqlQuery.Parameters.Add(New OracleParameter("menuno0", node.Parent.Value))
     Dim ResultSet As DataSet = RunQuery(sqlQuery)

     If ResultSet.Tables.Count > 0 Then
         Dim row As DataRow
         For Each row In ResultSet.Tables(0).Rows
    
             Dim NewNode As TreeNode = New TreeNode(row("MENU_DESC_2").ToString(), row("FORM_NAME").ToString())
             NewNode.NavigateUrl = "PDFViewer.aspx?PDFNAME =" & row("FORM_NAME").ToString()
             NewNode.Expanded = True
             NewNode.PopulateOnDemand = True
             NewNode.SelectAction = TreeNodeSelectAction.SelectExpand
             node.ChildNodes.Add(NewNode)
         Next
     End If
 End Sub


I want to know what is needed on the PDFViewer.aspx.vb page in the code behind to allow me to view the selected pdf.
I hope you can make some sense out of this?
Posted
Updated 19-Dec-13 3:38am
v2
Comments
ZurdoDev 18-Dec-13 11:04am    
Use the improve question link and show the relevant code and show us where you are stuck.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900