How to call C# function from HTML page?

  • Thread starter Thread starter Guest
  • Start date Start date
Jurate,

Are you trying to do this from an ASP.NET page, or are you using the web
browser control? If you are doing this from ASP.NET, then it is not
possible. You have to have the page perform a postback and then have the
code run on the server.

If you are hosting the web browser control, then you will have to
implement the IDocHostUIHandler interface. Once you do this, you would have
to define the ICustomDoc interface, and pass your implementation of
IDocHostUIHandler to it. The GetExternal method on IDocHostUIHandler will
return your implementation to the document, and you can make calls from
javascript or VB script through the inherent extern object.

Hope this helps.
 
Back
Top