When you set the Window's Visible attribute to true and the popup renders, the Blazor framework will fire the OnAfterRenderAsync event.
The OnAfterRenderAsync handler is the place to focus the desired textbox. Note that you will need a small delay ( await Task.Delay(300) ) to wait for the textbox JavaScript instance to initialize.
The OnAfterRenderAsync event fires a lot of times during the page life cycle. You will need a boolean flag to detect when to focus the textbox (e.g. FocusFlag ). Set this flag to true when you set the Window Visible attribute to true.
The following snippet demonstrates the above instructions. I also created this REPL example that you can use as reference.
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Thanks for the update. Above is for the button click event. I need for Page Intialization and I have tried for Page Intialization and it's not working. Could please update on the same.