Hi frds
i have nested multiviews and used menucontrol to navigate throught views this is my html code -
-
<asp:Menu ID="Menu1" Font-Bold="true" Orientation="Horizontal"
-
StaticEnableDefaultPopOutImage="False"
-
OnMenuItemClick="Menu1_MenuItemClick" runat="server" >
-
<StaticMenuItemStyle CssClass=MenuCell ItemSpacing=0px />
-
<StaticHoverStyle CssClass=MenuCellHover/>
-
<StaticSelectedStyle CssClass=MenuCellSelected ItemSpacing=0px />
-
</asp:Menu>
-
<asp:MultiView ID="mView1" runat="server" ActiveViewIndex="0">
-
<asp:View ID="View1" runat="server">
-
<asp:Label ID="lblView1" runat="server" Text="U r in view1"></asp:Label>
-
</asp:View>
-
<asp:View ID="View2" runat="server">
-
<asp:Label ID="lblView2" runat="Server" Text="U r in View2"></asp:Label>
-
</asp:View>
-
<asp:View ID="View3" runat="server">
-
<asp:Label ID="Label1" runat="Server" Text="U r in View2"></asp:Label>
-
</asp:View>
-
<asp:View ID="View4" runat="server">
-
<table>
-
<tr>
-
<td valign="top">
-
<asp:Menu ID="SubMenu1" runat="Server" Orientation="Vertical"
-
StaticEnableDefaultPopOutImage="false"
-
OnMenuItemClick="SubMenu1_MenuItemClick">
-
<StaticMenuStyle CssClass="MenuCell" />
-
<StaticHoverStyle CssClass=MenuCellHover />
-
<StaticSelectedStyle CssClass=MenuCellSelected />
-
</asp:Menu>
-
</td>
-
-
<td>
-
<table>
-
<tr>
-
<td>
-
<asp:MultiView ID="SubMultiView1" runat="server">
-
<asp:View ID="SubView1" runat="server">
-
<asp:Label ID="lblSubView1" runat="server" Text="u r in submenu"></asp:Label>
-
</asp:View>
-
<asp:View ID="SubView2" runat="server">
-
<asp:Label ID="lblSubView2" runat="server" Text="subview2"></asp:Label>
-
</asp:View>
-
</asp:MultiView>
-
</td>
-
</tr>
-
</table>
-
</td>
-
</tr>
-
</table>
-
-
-
</asp:View>
-
-
</asp:MultiView>
-
in code behind -
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
If Not Page.IsPostBack Then
-
Dim index As Integer
-
For index = 0 To mView1.Views.Count - 1
-
Menu1.Items.Add(New MenuItem(mView1.Views(index).ID, index.ToString()))
-
Next index
-
Menu1.Items(0).Selected = True
-
End If
-
End Sub
-
Protected Sub Menu1_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemClick
-
mView1.ActiveViewIndex = Int32.Parse(e.Item.Value)
-
End Sub
-
I'm able to display the main menu but i'm unable to display submenu which is in view4
can any one giv some idea how to proceed with this
thank u
Archu
2 5855
hi frs i tried n got the solution
here is the code for codebehind -
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
If Not Page.IsPostBack Then
-
Dim index As Integer
-
Dim m As MultiView
-
Dim v As View
-
Dim i As Integer
-
For index = 0 To mView1.Views.Count - 1
-
Menu1.Items.Add(New MenuItem(mView1.Views(index).ID, index.ToString()))
-
Next index
-
For Each v In mView1.Views
-
m = DirectCast(v.FindControl("SubMultiView1"), MultiView)
-
If v.Controls.Contains(m) Then
-
'For Each m In v.Controls.Contains(m)
-
For i = 0 To m.Views.Count - 1
-
CType(v.FindControl("SubMenu1"), Menu).Items.Add(New MenuItem(m.Views(i).ID, i.ToString))
-
Next
-
'Next
-
End If
-
Next
-
Menu1.Items(0).Selected = True
-
End If
-
End Sub
-
Protected Sub Menu1_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemClick
-
mView1.ActiveViewIndex = Int32.Parse(e.Item.Value)
-
End Sub
-
Protected Sub SubMenu1_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles SubMenu1.MenuItemClick
-
'mView1.ActiveViewIndex = Int32.Parse(e.Item.Value)
-
Dim v As View
-
For Each v In mView1.Views
-
CType(v.FindControl("SubMultiView1"), MultiView).ActiveViewIndex = Int32.Parse(e.Item.Value)
-
Next
-
End Sub
-
-
if any modification to do plz let me know
or any other simple way to achieve this
thank u
Archu
Frinavale 9,735
Recognized Expert Moderator Expert
Thanks for sharing the solution Archu!
I'm glad you figured it out!
:) :)
-Frinny
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Michael Hertz |
last post by:
I have hundreds of samples of XML documents on my harddisc. But all of them lack the one or another feature
of XML. Some XML documents have no attributes some others are rather flat (nesting...
|
by: Wolfgang Schwanke |
last post by:
Dear usenet,
I'm having the following small problem.
I've been ask to add some Quicktime panoramas to a website. The author of
the panoramas has made two versions of each: One in MOV format,...
|
by: CoolPint |
last post by:
I read in books that nested class cannot access private members of
nesting class and vice versa unless they are made friends. Somehow, my
compiler is letting my nested class member functions access...
|
by: Stromboli |
last post by:
Hi,
I have my site available in a couple of languages most of the files
are indexf.html (french), indexi.html (italian) and indexde.html
(german)..
I'd like to start using multiviews but I've...
|
by: Hardrock |
last post by:
I encountered some difficulty in implementing dynamic loop nesting.
I.e. the number of nesting in a for(...) loop is determined at run
time. For example
void f(int n)
{
For(i=0; i<=K; i++)...
| |
by: kl.vanw |
last post by:
I would like to count the nesting level in template classes. How can I
make the following work?
#include <assert.h>
template <class T>
class A {
public:
A() {
// what goes here?
|
by: stephen.cunliffe |
last post by:
Hi,
I'm looking for opinion/facts/arguments on the correct nesting of UL,
OL, & LI elements.
For example, this is what I want (unordered list):
* Item 1
* Item 2
* Item 3
|
by: henry |
last post by:
Folks
Here's a skeleton, generic HTML page, call it "index.php". You'll see a bit
of php code in the middle:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |