Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
hey fellow coders, i have a problem.

i want to link these following <li> links:
<li><a href="#"><span>1.1.1 Networking Today</span></a>
            <ul>
                <li id="one"><a href="#"><span>1.1.1.1 Networks in Our Daily Lives</span></a></li>
                <li id="two"><a href="#"><span>1.1.1.2 Technology Then and Now</span></a></li>
            </ul>
        </li>

and this is the multiview control:
<asp:MultiView ID="Chapter1" runat="server">
            <asp:View runat="server" ID="View1">
                <asp:Panel ID="Panel1" CssClass="MVPanel" runat="server">
                </asp:Panel>
            </asp:View>
            <asp:View runat="server" ID="View2">
                <asp:Panel ID="Panel2" CssClass="MVPanel" runat="server">
                </asp:Panel>
            </asp:View>
        </asp:MultiView>

so when i click on "1.1.1.1 Networks in Our Daily Lives" the multiview "View1" must show and so on...
any help would be appreciated.
Posted

You need to implement the links as LinkButtons. In your codebehind, you can switch the MultiView by changing the ActiveViewIndex.
 
Share this answer
 
Comments
Member 10985722 7-Sep-14 15:45pm    
i have put in link buttons labeled "previous" and "Next". but the links in the question is not part of the multiview, its a vertical menu strip.
Member 10985722 7-Sep-14 16:35pm    
OOOOOH, i take it back. you made me realise something bro! SHOT
sample code using ASP.NET & C#:

<br />
<br />
<form id="form1" runat="server"><br />
<asp:scriptmanager id="SM1" runat="server" xmlns:asp="#unknown" /><br />
<br />
<asp:updatepanel id="UP1" runat="server" xmlns:asp="#unknown"><br />
<contenttemplate><br />
<br />
<asp:multiview id="MultiView1" runat="server" activeviewindex="0"><br />
<asp:view id="View1" runat="server"><br />
This is View1. Click the button to goto View 2.<br />
</asp:view><br />
<asp:view id="View2" runat="server"><br />
This is View2. Enter your name and click the button to goto View 3.<br /><br />
Name: <asp:textbox id="fld_Name" runat="server" /><br />
</asp:view><br />
<asp:view id="View3" runat="server"><br />
<asp:literal id="lit_Name" runat="server" /> This is View3.<br />
</asp:view><br />
</asp:multiview><br />
<br /><br /><br />
<asp:button id="but_Submit" runat="server" text="Continue" onclick="but_Submit_Click" /><br />
<br />
</contenttemplate><br />
</asp:updatepanel><br />
</form><br />
<br />
<br />
<br />
Button_Click Event:<br />
<br />
<br />
protected void but_Submit_Click(object sender, EventArgs e)<br />
{<br />
     if (MultiView1.ActiveViewIndex == 0)<br />
     {<br />
          MultiView1.SetActiveView(View2);<br />
     }<br />
     else if (MultiView1.ActiveViewIndex == 1)<br />
     {<br />
          MultiView1.SetActiveView(View3);<br />
          if (String.IsNullOrEmpty(fld_Name.Text))<br />
          {<br />
               lit_Name.Text = "You did not enter your name. ";<br />
          }<br />
          else<br />
          {<br />
               lit_Name.Text = "Hi, " + fld_Name.Text + ". ";<br />
          }<br />
     }<br />
     else if (MultiView1.ActiveViewIndex == 2)<br />
     {<br />
          MultiView1.SetActiveView(View1);<br />
     }<br />
}<br />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900