1

I am trying to build a WP8.1 Universal App based on an empty C# Project. In the projectexplorer I can add / creata JS files but I cant find a way to make use of them within the C# project..

So what I am trying to do: Use C# code to access a function written in javascript, located in a JS file within the project.

Is there a way to do so or is this impossible?

Best regards and thanks for you help! --Flo

1 Answer 1

5

It's not directly possible.

A C# app can host HTML and JavaScript within a WebView control, but it cannot call it directly.

Depending on the details you may be able to load your page into a WebView and call it with the WebView's InvokeScriptAsync method then get a response via the ScriptNotify event, but this communication channel is very narrow and you'll likely be better off porting the code to C# if possible.

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

1 Comment

Thanks for your answer! This is what i wanted to know!

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.