Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help with accessing URL from button click event

Posted on 2015-01-24
11
Medium Priority
?
148 Views
Last Modified: 2015-01-24
Hi,

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

Thanks,

Victor
0
Comment
Question by:vcharles
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 64

Expert Comment

by:Fernando Soto
ID: 40568210
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
 

Author Comment

by:vcharles
ID: 40568229
Hi,

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

Victor
0
 
LVL 64

Expert Comment

by:Fernando Soto
ID: 40568334
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:vcharles
ID: 40568403
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
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 1600 total points
ID: 40568455
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
 

Author Comment

by:vcharles
ID: 40568538
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
 
LVL 11

Assisted Solution

by:louisfr
louisfr earned 400 total points
ID: 40568691
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
 
LVL 64

Expert Comment

by:Fernando Soto
ID: 40568763
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
 
LVL 64

Expert Comment

by:Fernando Soto
ID: 40568769
0
 

Author Comment

by:vcharles
ID: 40568798
Hi Fernando,

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

Thanks,

V.
0
 

Author Closing Comment

by:vcharles
ID: 40568802
Thank You.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question