Hi, I am using multiview webcontrol within which I have about 10 views, each view has a reference to user control (ascx page). with button Next or Prev I am switching active views. In my multiview I have set active view index to be the first view.
My only problem is I want to load only active view but its running all the asp page life cycle of sub-sequent view. i.e it is hitting all the break points of page load event for all the views. in page load i have lots of db calls and I want to only trigger the page load event for the view that is active. I have went through this article
https://msmvps.com/blogs/luisabreu/archive/2008/02/20/multiview-control-should-you-use-it.aspx[
^]
but its not helping, I am using vb code so I changed this to below code as per above article
Protected Overrides Sub Render(writer As HtmlTextWriter)
Dim contentPlaceHolder As ContentPlaceHolder = DirectCast(Master.FindControl("cphBody"), ContentPlaceHolder)
Dim activeView As String = myMultiview.GetActiveView.ID
If activeView IsNot Nothing Then
contentPlaceHolder.FindControl(activeView).RenderControl(writer)
End If
End Sub
I would really appreciate if anyone can point me to right direction. thanks