سؤال

I have an issue that is opposite to this question Open link in IE on Windows store metro apps

I have a windows store app that the user logs in to a web page and navigates to different pages, all https. But some pages seem to open in the IE browser resulting in the IE browser querying the user for the logon and password again since its a new browser.

I dont want it to open in the IE broswer but all links to remain opening within the webview instance in the app.

Here are snipets from my code (teamScreen private string declared globally)

string teamScreen = "https://mysite.com/Login.aspx?" + "username=" + logInUserIdString + "&password=" + logInPasswordString + "&mobile=1&offsetHours=" + timezone;

 protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Uri targetUri = new Uri(teamScreen);
            webView1.Navigate(targetUri);
        }

How can I stop a link in webview from opening externally?

Thanks

هل كانت مفيدة؟

المحلول

WiredPrairie hit the issue head on.

Server chap had some new links in the page with target="_black" which forces a new tab in the browser. So is assume the Windows Store App webview does not allow for tabs and it forced the web page to open the IE browser on the device.

Once removed, issue gone.

Was not an issue with the iPhone/iPad or Android version of the app and not sure why. Same back end code, either way fixed.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top