Is there a way to programmatically close a razor page?

I have a page, which calls another page as DialogService (popUp). When something is modified and user presses a button on that popup page, I want this page to close automatically (do not want user to click "Close (x)" button at the title. Is there a way for this?

Hi @ShishirDahal,
for Dialogs just use DialogService.Close() or even DialogService.Close().

Thomas