hi friends...
i want to link a buuton to an html page. i knx there is its control in the toolbox bt i don't know how to use it.. need help plzz

Dani AI

Generated

This thread mixes two different scenarios, so first pick your target, : desktop (WinForms/WPF) or web (ASP.NET Web Forms). The right approach depends on that.

If this is a desktop VB.NET app: opening an HTML page should use the user’s default browser, not a hardcoded path. showed one way, but you do not need to point at iexplore.exe. Let Windows do the work and handle errors cleanly.

Try
    Dim url As String = "https://example.com/page.html"
    Dim psi As New ProcessStartInfo(url) With {
        .UseShellExecute = True  'opens with the system default browser
    }
    Process.Start(psi)
Catch ex As Exception
    MessageBox.Show("Could not open the page: " & ex.Message)
End Try

Tip: validate the URL first (e.g., Uri.IsWellFormedUriString). A LinkLabel as suggested is fine for a link-style UI; use a Button if you want a button UI, but keep the same ProcessStartInfo pattern.

If this is ASP.NET Web Forms: you do not need a postback to navigate. Either use a plain link or make the button do a client-side redirect so it feels instant.

<asp:Button runat="server" Text="Open page"
    OnClientClick="window.location.href='page.html'; return false;" />

If you truly want server-side navigation (e.g., to run logic first), do it in the click handler:

Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Response.Redirect("~/page.html", False)
End Sub

Finally, , when navigating to another form in a desktop app, Show() opens non-modal, while ShowDialog(Me) opens modal. Pick the one that matches your workflow and dispose the form when done.

Hi
In vb.net you having a tool named Link Label.
Use the link label to link a HTML Page to your form.

Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal_
e As System.Windows.Forms.LinkLabelLinkClickedEventArgs)_
Handles LinkLabel1.LinkClicked
System.Diagnostics.Process.Start("")
'using the start method of system.diagnostics.process class
'process class gives access to local and remote processes
End Sub

Give your target like("c:\...") inside the System.Diagnostics.Process.Start() method.

For further clarification see the following link
http://www.startvbdotnet.com/controls/label.aspx

I can't go smarter than this (I'm no expert), but following worked for me:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Shell("C:\Program Files\Internet Explorer\iexplore.exe ")

    End Sub

Change "iexplore.exe" and its directory to a browser of your choice.

Or else, you can do what "suganzeni" suggested but inside your button code. e.g.:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        System.Diagnostics.Process.Start("")

    End Sub

how to link buttons using the visual studio 2005.. and to another form... tnx

Say you have form called "Settings" (). Wouldn't double-clicking button and typing following work?:

Settings.Show()

Leo

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.