Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7569581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:12:07+00:00 2026-05-30T15:12:07+00:00

I have to create a simple webpage on asp.net 4 with vertical slidedown slideup

  • 0

I have to create a simple webpage on asp.net 4 with vertical slidedown slideup menu using jQuery.
So I’ve wrote my menu in WebUserControl:

<asp:Menu ID="Menu" CssClass="mainMenu" Orientation="Vertical" runat="server" StaticDisplayLevels="3"
    StaticSubMenuIndent="0">
    <Items>
        <asp:MenuItem Text="Text1" />
        <asp:MenuItem Text="Text2">
            <asp:MenuItem Text="text2" />
            <asp:MenuItem Text="text2" />
            <asp:MenuItem Text="text2" />
            <asp:MenuItem Text="text2" />
        </asp:MenuItem>
        <asp:MenuItem Text="Text3">
            <asp:MenuItem Text="text3" />
            <asp:MenuItem Text="text3" />
            <asp:MenuItem Text="text3" />
            <asp:MenuItem Text="text3" />
        </asp:MenuItem>
        <asp:MenuItem Text="Text4" />
    </Items>
</asp:Menu>

Then added WebUserControl to my Default.aspx and wrote styles for menu:

.mainMenu
{
    background-color: #d9dada;
    min-width: 230px;
    height: auto;
    min-height: 300px;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    border-radius: 10px;
    padding-left: 20px;
    padding-top: 40px;
}
.level1
{
    color: #434242;
    background-color: #d9dada;
    width: 190px;
    padding-left: 20px;
    height: 35px;
    font-size: 18px;
}
.level2
{
    color: #727271;
    background-color: #fefefe;
    padding-left: 20px;
    width: 190px;
    height: 35px;
    font-size: 18px;
}

Then located Default.aspx in MasterPage and wrote jQuery script for my menu:

<div class="menuContainer">
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
        <script type="text/javascript">
            $(document).ready(function () {
                $(".level2").hide();
                $(".level1").click(function () {
                    $(this).next(".level2").slideToggle("slow");
                    return true;
                });
            });
        </script>
   </div>

When I run my project it hides submenus but can’t show them. How I can fix it? Is there a mistake in javascript or I wrote css styles wrong?
Here is HTML generated code:

<div class="mainMenu" id="ContentPlaceHolder1_ctl00_Menu">
    <ul class="level1">
        <li><a class="level1" href="#">Text1</a></li>
        <li><a class="level1" href="#">Text2</a></li>
        <li><a class="level2" href="#">text2</a></li>
        <li><a class="level2" href="#">text2</a></li>
        <li><a class="level2" href="#">text2</a></li>
        <li><a class="level2" href="#">text2</a></li>
        <li><a class="level1" href="#">Text3</a></li>
        <li><a class="level2" href="#">text3</a></li>
        <li><a class="level2" href="#">text3</a></li>
        <li><a class="level2" href="#">text3</a></li>
        <li><a class="level2" href="#">text3</a></li>
        <li><a class="level1" href="#">Text4</a></li>
    </ul>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T15:12:09+00:00Added an answer on May 30, 2026 at 3:12 pm

    As others have mentioned in the comments, you really shouldn’t be relying on JavaScript for the menu to even work.

    HTML Dog has a fairly extensive collection of tutorials to explain how to achieve the basic effect with CSS + progressive enhancement with JavaScript, which you can find here: http://www.htmldog.com/articles/suckerfish/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a webpage built in asp.net c#. it always a user to create
I have a webpage using jquery 1.42 The following 2 segments of code live
I have various simple ASP.NET MVC views for CRUD operations which work fine on
I used Phonegap to create a simple webpage as an iPhone app. I'm using
I have a webpage in ASP.NET 3.5 that will be creating WebControls dynamically. The
I have created a sample project using ASP.NET MVC 3 Web Application (Razor) template.
I have a requirement to create a simple database in Access to collect some
I have a requirement to create a simple windows forms application that allows an
I have been trying to create a simple program with Python which uses OpenCV
I have used following code to create a simple PDF file. It executes fine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.