Hi everyone,
I am developing a module for dotnetnuke;
In my ascx file, I have something similar to this:
<asp:panel>
<asp:btn1>
<asp:btn2>
<asp:multiview>
<view1>
<controls with autopostBack />
</view>
<view2>
</view>
</multiview>
</panel>
On page.init, I use ajax.wrapupdatepanelcontrol on the panel; using btn1 and btn2, I select one of the views.
The problem is that, when I trigger another control, the currently selected view is reset, as if the selected view index is not mantained across postbakcs; obvusly, not wrapping the panel, everything works fine.
Is there an option or something to keep the selected page "automatically"?
The solution that comes to my mind is:
1 - save somewhere the selectedViewIndex;
2 - at each postBack, during pageLoad, check the stored value and set the activeView
Just would like to know if there's some better solution..
Thank you in advance,
Alberto
[EDIT]
For now, I solved that way..
when I activate a specific view, i also store its index in a a viewstate variable; than, during pageLoad, I check the value and re-set the multiview with the correct viewindex
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
multiView.ActiveViewIndex = ViewState("MyVar")
End Sub
protected sub selectView(byval index as int)
multiView.ActiveViewIndex = index
ViewState("MyVar") = index
end sub