question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot convert method group 'startsearch' to non-delegate type 'object'. Did you intend to invoke the method?

See original GitHub issue

I get this when calling on a method in @@functions{} from onclick in an elment. This happens in my web api projects, it’s done exactly the same as in blazor template.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

11reactions
SteveSandersonMScommented, Jul 1, 2019

onclick should now be @onclick. We made this syntax change in preview 6 - it’s the final event-handler syntax for the 3.0 release.

0reactions
SteveSandersonMScommented, Jul 17, 2019

Thanks @tjorxwrynch for the suggestion!

The good news is that this change has already been made in the latest template source code: https://github.com/aspnet/AspNetCore/blob/master/src/Components/Blazor/Templates/src/content/BlazorWasm-CSharp/Client/Pages/Counter.razor#L7

Read more comments on GitHub >

github_iconTop Results From Across the Web

C# cannot convert method to non delegate type
1. Because you need to call it, eg obj.getTitle() · 1. Have you tried searching the googles? This is a fairly common beginner's...
Read more >
Compiler Error CS0428
This error occurs when converting a method group to a non-delegate type, or attempting to invoke a method without using parentheses. Example.
Read more >
Cannot convert method group 'x' to non-delegate type 'bool'.
Cannot convert method group 'IsGrounded' to non-delegate type 'bool'. Did you intend to invoke the method? Please help me, how do I fix...
Read more >
MVC - Fix Error - CS0428 Cannot convert method ... - YouTube
CS0428: Cannot convert method group 'GetValueOrDefault' to non - delegate type 'bool'. Did you intend to invoke the method ?
Read more >
error CS0428: Cannot convert method group 'Bar' to non- ...
error CS0428: Cannot convert method group 'Bar' to non-delegate type 'void*'. Did you intend to invoke the method? ; Project, ReSharper ; Subsystem,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found