【发布时间】:2015-02-25 23:18:22
【问题描述】:
在我的aspx页面上,我在TreeView的每个节点的左侧都有TreeView,我想加载一个不同的ascx,它只会改变页面的右侧。
这就是我的 aspx.vb 的样子:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
RetrieveAllQueryStringParams()
If Not IsPostBack Then
GenerateDataSets()
GenerateLabels()
GenerateLinks()
GenerateControls()
GenerateOther()
End If
End Sub
当它到达 GenerateLinks()
Protected Sub GenerateLinks()
Dim subTreeStatisticalReport As RadTreeNode = rtvReports.Nodes.FindNodeByValue("StatisticalReport")
Dim subTreeIncidentComparisons As RadTreeNode = rtvReports.Nodes.FindNodeByValue("IncidentComparisons")
Dim subTreeGeographicLocations As RadTreeNode = rtvReports.Nodes.FindNodeByValue("GeographicLocations")
Dim statTimeOfDayNode As RadTreeNode = subTreeStatisticalReport.Nodes.FindNodeByValue("TimeofDay")
Dim statTrendsNode As RadTreeNode = subTreeStatisticalReport.Nodes.FindNodeByValue("Trends")
Dim statTopSevenIncidents As RadTreeNode = subTreeStatisticalReport.Nodes.FindNodeByValue("Top7Incidents")
Dim statIncidentPerCategory As RadTreeNode = subTreeStatisticalReport.Nodes.FindNodeByValue("IncidentsPerCategory")
Dim compIncidentLoss As RadTreeNode = subTreeIncidentComparisons.Nodes.FindNodeByValue("IncidentLoss")
Dim GeoMaps As RadTreeNode = subTreeGeographicLocations.Nodes.FindNodeByValue("Maps")
statTimeOfDayNode.NavigateUrl = Globals.gRootRelativeSecureURL("/Reports/Reports.aspx?SessionID=" + m_SessionID + "&qrptTOD=tod")
End Sub
现在,如果用户要单击时间节点,它将再次加载相同的页面,但 ascx 不同。
Private Sub RetrieveAllQueryStringParams()
Try
If Not String.IsNullOrEmpty(Request.QueryString("SessionID")) Then
m_SessionID = Request.QueryString("SessionID")
m_qrptTOD = Request.QueryString("qrptTOD")
ElseIf Not String.IsNullOrEmpty(Session("SessionID")) Then
m_SessionID = Session("SessionID")
End If
If m_qrptTOD = "tod" Then
Page.LoadControl("/Controls/Reports/rptTimeOfDay.ascx")
End If
Catch ex As Exception
End Try
End Sub
当它到达这里时:
If m_qrptTOD = "tod" Then
Page.LoadControl("/Controls/Reports/rptTimeOfDay.ascx")
End If
ascx 页面由于某种原因无法加载!! 我做错了什么?!?!?
【问题讨论】:
标签: c# asp.net vb.net treeview