✅ is there a way to add a C# event handler to .cshtml button
title says it all.
i want a button that changes the text of a <p> element when pressed
13 Replies
Judging by
.cshtml
, you're not using Blazor, but rather MVC or Razor Pages
So the answer is no
Use Javascripti can use Blazor as well im just trying to test stuff
what is the blazor way to do it
If you use Blazor then yes, you can
will it run client side
Blazor WASM will, yes
bet
cause i want to make smth small with a library that cant be used on most servers
im getting some "Operation not supported on this platform"
you can do it server side with blazor
![SCgetoutofmyhead](https://cdn.discordapp.com/emojis/841888624387817492.gif)
you can't run C# code on the client outside of blazor WASM or blazor hybrid
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
I got it to ![SCCUTE](https://cdn.discordapp.com/emojis/664512325142839308.gif)
![SCCUTE](https://cdn.discordapp.com/emojis/664512325142839308.gif)
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Use the /close command to mark a forum thread as answered