3

I'm using a Tab control in WPF and the Tab control contains a WebBrowser control in first tab. I have some scripts and HTML content for the Webbrowser control and this works fine. Also I'm able to invoke the script method written inside the HTML content, but I need the vice versa as need to invoke a C# method from Javascript method.

Is it possible?

1
  • is the C# method exposed as webmethod? Commented Jun 27, 2012 at 15:08

1 Answer 1

2

You can specify an object which is accessible to be called directly from your JavaScript. Check out the property ObjectForScripting on the WebBrowser control for more information.

Also, here is another post which outlines it even better: Hosting and interacting with a webpage inside a WPF App

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.