Open a popup when user tries to move away from current page

I have a page where user might have entered some data. If S/He tries to go away from that page Or tries to close that page, I want to warn the user that his content will be lost. How do I do that? Is there a way of doing that without JS?

ANy help on this would be appreciated

Your question seems unrelated to Radzen.Blazor components. It is better to ask generic Blazor questions on StackOverflow.