Help with accessing URL from button click event

Hi,

How do you activate a URL from a button click event using VB.NET?

Thanks,

Victor
vcharlesAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Fernando SotoConnect With a Mentor RetiredCommented:
Hi Victor;

This is the reason why I wanted to know what platform you wanted to get access to the Web page in a previous response.

From a Windows application you can download the web page as a string as follows.

Imports System.Net

Dim wc As New WebClient()
Dim Url As String = "http://www.eggheadcafe.com"
Dim result As String = wc.DownloadString(Url)

Open in new window

0
 
Fernando SotoRetiredCommented:
Hi Victor;

Not sure if I can help with this one. What platform Windows Form, Web application? What do you mean by activate a URL?
0
 
vcharlesAuthor Commented:
Hi,

I mean a web application (i.e. http://www.experts-exchange.com)

Victor
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Fernando SotoRetiredCommented:
Hi Victor;

Please see this Microsoft documentation on two ways to achieve this client side or server side.

How to: Redirect Users to Another Page
0
 
vcharlesAuthor Commented:
Hi,

Unfortunately it does not work because I'm trying to access a web page from a Windows form, the article is for accessing a web page from a web page.


Thanks,

Victor
0
 
vcharlesAuthor Commented:
Hi,

I tried the code below but the web page does not appear.

Imports System.Net

 Private Sub Button17_Click(sender As System.Object, e As System.EventArgs) Handles Button17.Click
        Dim wc As New WebClient()
        Dim Url As String = "http://www.yahoo.com"
        Dim result As String = wc.DownloadString(Url)
    End Sub

V.
0
 
louisfrConnect With a Mentor Commented:
If you want to open the page in a browser, call Process.Start with the address as parameter:
Process.Start Url

Open in new window

0
 
Fernando SotoRetiredCommented:
Hi Victor;

The code I posted will bring the web page in HTML format into a string variable, is that not what you wanted? If you want to display that in a Windows form you can use a web browser control.
0
 
Fernando SotoRetiredCommented:
0
 
vcharlesAuthor Commented:
Hi Fernando,

Alp needed to view the page, last part of the code from the other post worked.

Thanks,

V.
0
 
vcharlesAuthor Commented:
Thank You.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.