This is insufficient information for us to help you. ASPX files are only used by Web Forms. What UI framework are you using (Web forms, MVC, etc)? If you're using Web Forms then open the Toolbox window in VS 2022 while you have the designer of the form open and it will show you a list of controls. One of those controls is a menu. Drag and drop it onto your form. The full steps needed to add a menu to a page are beyond what can be reasonably posted in a Q&A forum. You should use the many available online resources to get your answer. Here's a starter link.
Note also that I don't understand what you mean by "renamed the extension of a form to aspx". You shouldn't be renaming anything and if you did that then you've probably broken stuff. To add a new Web form to an existing project you use the Add New Item menu, find the Web Form item and select it. This auto generates the files needed for a web form page. It is not a single file that you can simply rename. If you did rename an existing file to .aspx then you need to undo those changes.