I am currently working on an ASP.NET application that is hosted by a C# application using WebBrowser. The ASP.NET application runs within the C# application environment.
My challenge lies in finding a way to notify the C# application when certain events, such as button clicks, occur. It seems like utilizing Javascript would be the most suitable approach. However, the issue I'm facing is that the only URL visible to the C# application is /Default.aspx. Therefore, all JavaScript functions (e.g., window.external.myfunc(..)) must be accessed from this page.
Do you have any suggestions or ideas? I've hit a roadblock and could use some guidance. Additionally, I'm unsure about how to invoke JavaScript functions from the code-behind. I've seen ScriptManager.RegisterClientScriptBlock being used frequently, but can it be called multiple times on a single page?
Thank you in advance for your help!
Just to provide more context, I am using WebBrowser.ObjectForScripting in the C# client to connect with a custom object that handles these window.external function calls from JavaScript. So far, this setup has been effective.