Clicking F12 not entering code behind from aspx.page in visual studio 2019, ie clicking on event handler

Kalpana 291 Reputation points
2021-02-18T08:27:45.413+00:00

Hi

I am facing this issue with the Visual Studio 2019 Community Edition, when I create the event handler - for example OnClick, the previous version would show the code behind file automatically, now the file is opened, but I have to click on it and write the code.

I am facing this issue with while working on Web Application Project.

Do I need to enable something to get it to work ?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,059 questions
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 116.7K Reputation points
    2021-02-19T08:58:30.133+00:00

    It seems that this feature is not currently available for Web projects, but it still works in case of WPF, for example. As a workaround, you can press <F7> to switch from design to code and go to function.

    Another alternative to <F12>: put the caret inside the attribute value and press <Ctrl+,> etc.


1 additional answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 30,356 Reputation points Microsoft Vendor
    2021-02-19T07:22:43.963+00:00

    Hi @Kalpana ,

    Welcome to Microsoft Q&A forum.

    Normally, F12 keyboard shortcut is used for GoToDefinition, NavigatetoProject … as default features, but from your description, you are using F12 to navigate to event handler(codes)? Or you mean the OnClick code in Source View of .aspx file? Could you please share reproducible steps and some screenshots with me to test and confirm this issue on my side?

    If you want to go to(and automatically create) the event handler, does double-click the control work on your side?

    Best Regards,
    Tianyu

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    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.