you can use the QueryString to pass the ViewIndex from the TreeView :
this is a working example :
in master page :
this is the treeView:
<asp:TreeView ID="jhhhj" runat="server">
<Nodes>
<asp:TreeNode NavigateUrl="inserir.aspx?view=1" Text="First View"></asp:TreeNode>
<asp:TreeNode NavigateUrl="inserir.aspx?view=2" Text="Second View"></asp:TreeNode>
<asp:TreeNode NavigateUrl="inserir.aspx?view=3" Text="third View" ></asp:TreeNode>
</Nodes>
</asp:TreeView>
declare the MutiView in inserir.aspx :
<asp:MultiView ID="MultiView1" runat="server">
<asp:View ID="View1" runat="server">
FirstView
</asp:View>
<asp:View ID="View2" runat="server">
Second View</asp:View>
<asp:View ID="View3" runat="server">
Third View</asp:View>
</asp:MultiView>
and in inserir.aspx page_Load , get the Passed Query string as follows:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Request.QueryString("view") IsNot Nothing Then
Dim ViewIndexs As Integer = Integer.Parse(Request.QueryString("view"))
' need to subtract -1 because its strt from zero
Me.MultiView1.ActiveViewIndex = ViewIndexs - 1
End If
End Sub
Regards,
Anas Ghanem |
My Blog |
Online VB - C# Converter |
Aljazeera