Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open webbrowser with specific url in WP7

How would i go about opening the webbrowser with a specific url on button click.


2 Answers

Put the following code in the button Click event handler:

var task = new Microsoft.Phone.Tasks.WebBrowserTask
            {
        URL = uri
            };

            task.Show();
like image 103
Michael S. Scherotter Avatar answered Jan 26 '26 20:01

Michael S. Scherotter


with this code on button handler event you can navigate to the url assigned to var URL

        WebBrowserTask wbTask = new WebBrowserTask();
        var URL = "http://create.msdn.com";
        wbTask.Uri = new Uri(URL, UriKind.RelativeOrAbsolute);
        wbTask.Show();
like image 30
Eduardo Matos Avatar answered Jan 26 '26 20:01

Eduardo Matos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!