Selecting “Click Event” name from intellisense does not create method in VS 2019

Uncle Vince 41 Reputation points
2020-11-05T13:42:58.02+00:00

Hi all,

On the form in markup page in C# I have created a ImageButton with ID "imgbtn".

Added "OnClick" Event to it.

The intellisense don't suggest name "imgbtn_Click".

I am running "Visual Studio for Windows" version 16.7.7

Any idea for solve this problem?

Thanks in advance for any help.

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

Accepted answer
  1. Tianyu Sun-MSFT 30,356 Reputation points Microsoft Vendor
    2020-11-06T10:02:28.34+00:00

    Hi @GaglianiCaputoVincenzoIRQUA-1155,

    Thank you for your feedback.

    I have followed your description and tested on my side, but it worked well on my side. So I think this issue may be caused by the environment(IDE, cache…).

    37998-test1.png

    37858-test2.png

    38025-test3.png

    Please follow steps below to troubleshoot.

    1). Go to your solution(project) folder and rename or delete the hidden .vs, bin and obj folders, then test again.

    2). Please close every VS instances and go to this path: C:\Users\Administrator\AppData\Local\Microsoft\VisualStudio\16.0_XXXX and rename or delete every ComponentModelCache folders, after that restart VS and try to add the click event.

    3). Please try to disable any third-party extensions from VS > Extensions > Manage Extensions > Installed > Disable.

    4). Please try to create a new website empty project and add(copy > paste) the necessary codes in the newly created project and try to create a ImageButton with ID imgbtn, then check if Intellisense works. If this issue still persists, please also try to reset VS settings and repair VS from VS Installer > VS 2019 > More > Repair.

    Sincerely,
    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

2 additional answers

Sort by: Most helpful
  1. Uncle Vince 41 Reputation points
    2020-11-06T08:40:00.713+00:00

    Hi, thanks for reply.

    My project is new website empty in C#

    On this project I have added new webform Default.aspx and on the markup I have created a ImageButton with ID "imgbtn".

    If try adding code on this post I have this reply:

    Access Denied
    You don't have permission to access "http://learn.microsoft.com/answers/answers/152765/post.html" on this server.
    Reference #18.b50c1502.1604651962.1d896a73

    0 comments No comments

  2. Uncle Vince 41 Reputation points
    2020-11-06T10:27:53.03+00:00

    Thank you now VS 2019 working correctly!

    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.