Cannot drag Menu from the Toolbox in ASPX

Simon 306 Reputation points
2025-01-14T01:07:55.3133333+00:00

The menu was accidentally deleted from my ASPX project, and when I tried dragging it from the Toolbox, it would not work.

How can I bring back the menu?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,041 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,563 questions
{count} votes

Accepted answer
  1. Michael Taylor 56,091 Reputation points
    2025-01-14T16:13:02.9066667+00:00
    Go to `Tools \ Options` and then to `Web Forms Designer`. If you are using `Web Live Preview` then switch back to the legacy designer. Restart VS. I suspect the issue is that the ASPNET Menu control isn't supported with Web Live Preview.
    
    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Michael Taylor 56,091 Reputation points
    2025-01-14T15:31:33.03+00:00

    A couple of things that prevent drag and drop from working.

    1. If the web app is being debugged right now then the designer is generally read only. Ensure you are not actively debugging the app.
    2. The designer shows you the entire page layout including any raw HTML and parent/master page content. You cannot drag/drop a control onto parent/master page layout. Furthermore you cannot drag/drop a control onto a control that doesn't support children (e.g. text box). Ensure you are drag/dropping onto either the body or a div.

    Test to see if this is just a menu issue. Can you drag/drop a textbox or button onto the form without issue?

    If you previously had it on the form then can you revert back to your old version in source control?

    A final approach is to simply open the markup editor where you can see the raw HTML and put in the control manually so it shows up. Basically that means the base HTML element, the id and name attributes and the runat attribute. After that you should be able to switch back to the designer and see the control so you can edit the rest of the stuff.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.