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.

Blazor @onclick event not firing when using Windows Authentication

See original GitHub issue

This issue has been moved from a ticket on Developer Community.


Hi

Without changing a thing, I:

Creating a new Blazor App with default temple works great thank you.

Creating a new Blazor App changing the Authentication to Windows Authentication, I discovered that:

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button> onclick event does not fire?

Is this a bug or am I missing something?

Using VS Community 2019 Version 16.3.9

Best regards


Original Comments

Johannes denToom on 11/13/2019, 09:17 PM:

Changing the launchsetting.json file:

"iisSettings": {
"windowsAuthentication": true,
"anonymousAuthentication": true,

onclick event fires again, however Windows Authentication doesn't

"anonymousAuthentication": false,

onclick event does not fire.



Visual Studio Feedback System on 11/14/2019, 02:14 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ghidellocommented, Nov 24, 2019

I had the same issue using google chrome with the “Avast Online Security” extension. These are the console logs after loading the Counter page:

Information: Starting up blazor server-side application.
Information: Normalizing '_blazor' to 'https://localhost:44304/_blazor'.
Debug: Starting HubConnection.
Debug: Starting connection with transfer format 'Binary'.
Debug: Sending negotiation request: https://localhost:44304/_blazor/negotiate?negotiateVersion=1.
Debug: Selecting transport 'WebSockets'.

It looks like it stopped before logging the web socket connection.

If I disable the Avast extension the application starts working normally and these are the console logs:

Information: Starting up blazor server-side application.
Information: Normalizing '_blazor' to 'https://localhost:44304/_blazor'.
Debug: Starting HubConnection.
Debug: Starting connection with transfer format 'Binary'.
Debug: Sending negotiation request: https://localhost:44304/_blazor/negotiate?negotiateVersion=1.
Debug: Selecting transport 'WebSockets'.
Information: WebSocket connected to wss://localhost:44304/_blazor?id=gB2WiOanTuJCjQvWyicSgQ.
Debug: The HttpConnection connected successfully.
Debug: Sending handshake request.
Information: Using HubProtocol 'blazorpack'.
Debug: Server handshake complete.
Debug: HubConnection connected successfully.
Debug: Received render batch with id 2 and 4592 bytes.
Debug: Applying batch 2.
Information: Blazor server-side application started.
Debug: Received render batch with id 3 and 122 bytes.
Debug: Applying batch 3.

These are the server logs: server_logs_with_avast_plugin.log server_logs_without_avast_plugin.log

Before enabling the windows authentication I’ve never had a problem with this browser extensions.

0reactions
ghidellocommented, Nov 29, 2019

Avast Online Security version 19.2.289 The extension icon appears greyed out on my blazor application but I’m testing on localhost and I don’t know if that’s the reason. If I press the icon while writing this message on github, none of the checkboxes in the “Automatically block all trackers” section is selected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blazor @onclick event not firing when using Windows ...
Creating a new Blazor App changing the Authentication to Windows Authentication, I discovered that: <button class="btn btn-primary" @onclick=" ...
Read more >
Blazor onclick event not triggered
I try to implement a simple onclick event handler like this sample https://blazorfiddle.com/s/counter but not working in my solution. The event ...
Read more >
Why does the onclick event not work, in my razor pages ...
I've used the following code in multiple blazor web assembly applications hosted on a razor pages page under .net 5.0 and .net 6.0...
Read more >
ASP.NET Core Blazor authentication and authorization
Blazor WebAssembly apps run on the client. Authorization is only used to determine which UI options to show. Since client-side checks can be ......
Read more >
Call JavaScript functions from .NET methods in ASP. ...
The app must handle the UI event completely in JavaScript, so use onclick instead of Blazor's @onclick directive attribute.
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