-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Milestone
Description
I'm developing my first blazor server side application. I need to capture onscroll
event of window
or body
in my blazor server side application. Right now I implemented this using a script file where I capture the event and do my logics in there as shown below.
For window
:
window.onscroll = function() {myFunction()};
function myFunction() {
// ... my logics here
}
How to capture onscroll
event of body
tag? In blazor server side body
is in _Host.cshtml
file where I cannot use @onscroll
since it is not a component
For body
:
<body onscroll="myFunction()">
The above one works but I'm not happy with this implementation while using blazor.
Please assist on how to implement this purely with C# or it is acceptable to use Javascript for this. I'm confused.
Metadata
Metadata
Assignees
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components