Hi
I have the below code. It works fine but it takes a long time to load on the browser page. Is there anything I can do to shorten this time?
Also, I would like to search the file for documents with NAME starting with A, B, C, etc. How do I do that?
Thanks for your help!
aspx.vb page
aspx page
I have the below code. It works fine but it takes a long time to load on the browser page. Is there anything I can do to shorten this time?
Also, I would like to search the file for documents with NAME starting with A, B, C, etc. How do I do that?
Thanks for your help!
aspx.vb page
Code:
Dim xdoc As New XPathDocument(xt)
Dim nav As XPathNavigator = xdoc.CreateNavigator()
Dim expr As XPathExpression
expr = nav.Compile("/pf:CONTRACTS/pf:CONTRACT")
Dim namespaceManager As XmlNamespaceManager = New XmlNamespaceManager(nav.NameTable)
namespaceManager.AddNamespace("pf", "http://namespace/")
expr.SetContext(namespaceManager)
Dim nodes As XPathNodeIterator = nav.Select(expr)
If nodes.Count <> 0 Then
Dim tr As String = Nothing
For Each node As XPathNavigator In nodes
tr += "<td><a Target='_blank' href='http://www.urltosite.aspx?contract=" & node.SelectSingleNode("pf:ID", namespaceManager).Value & "'>" & node.SelectSingleNode("pf:NAME", namespaceManager).Value & "</a></td>"
For Each subNode2 As XPathNavigator In node.Select("pf:SUPPLIERS/pf:SUPPLIER", namespaceManager)
tr += "<td>" & subNode2.SelectSingleNode("pf:SUPPLIERNAME", namespaceManager).Value & "</td>"
Next
tr += "<td>" & node.SelectSingleNode("pf:ENDDATE", namespaceManager).Value & "</td>"
tr += "</tr>"
Next
Dim th As String = "<th width='50%'>Name</th><th width='30%'>Supplier</th><th width='20%'>End Date</th>"
div1.InnerHtml = ("<table width='96%' border='0' cellpadding='0' cellspacing='0' border='0' class='datatable1'>" & th) + tr & "</table>"
Else
div1.InnerHtml = "No results for your search"
End If
aspx page
Code:
<div id="div1" runat="server" > </div>
Comment