WinRT webview go back?

173 views Asked by At

I'm trying to get the webview to go back but I'm having a little problem. Here is my code:

Blog.InvokeScript("eval", new[] { "history.go(-1)" });

The error says use InvokeScriptAsync.. How do I go about doing that? Sorry, I'm new to programming.

Also will the same code work for going forward? ( instead of -1, use +1)?

2

There are 2 answers

0
Paulo Morgado On BEST ANSWER

Whit the little context you gave, I can only speculate:

WebView.InvokeScriptAsync method

async Task SomeMethod()
{
    await Blog.InvokeScript("eval", new[] { "history.go(-1)" }); 
}

History go() Method

0
Martin Konopka On

The WebView comes with GoBack method. Does it not work for you?