473,404 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Button click to open a webpage ?

Hi,

I am new in C sharp.

I make a button, when users click the button, I want it to open a webpage
(for example www.yahoo.com )

How to do? What should the code be?

Thanks!
Martin

Mar 13 '08 #1
2 3592
Martin,

First things first, where is the button resued, either in windows
application or web application.

At windows application, you can instantiate a new window having the widows
webbrowser control and give the reference to what ever url that you want.

In web app, you could simply write a javascript function which will open a
new browser instance and navigate you to the given url. Search for
"window.open".
At the web, use the below like command with in your javascript

window.open("Sample.html",SampleWindow,
"height=100,width=100,status=yes,toolbar=nyes ,Target=_blank")

HTH

"Martin (Martin Lee)" <la*********@21cn.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi,

I am new in C sharp.

I make a button, when users click the button, I want it to open a webpage
(for example www.yahoo.com )

How to do? What should the code be?

Thanks!
Martin
Mar 13 '08 #2
On Wed, 12 Mar 2008 23:44:39 -0700, Martin (Martin Lee)
<la*********@21cn.comwrote:
Click a button and then it will open www.yahoo.com
That's what I need.
But what does "open" mean? Do you want to display the web page in your
own application? Do you want to start a new browser process? Something
else?

If the latter, see Bjorn's reply. If the former, then as I already wrote,
the WebBrowser control should be useful. If something else, you'll need
to be more specific.

Pete
Mar 13 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: PK | last post by:
Hello, I am looking for help on the following. I'm trying to create a custom browser toolbar button that will do a few things. One that I'm trying to do at the moment is just simply return the...
12
by: Elliot Temple | last post by:
How do I make Python press a button on a webpage? I looked at urllib, but I only see how to open a URL with that. I searched google but no luck. For example, google has a button <input...
3
by: Margaret | last post by:
How do I open a webpage in a new browser window? One that doesn't have any back button/forward button or refresh?
15
by: qwweeeit | last post by:
Hi all, Elliot Temple on the 1 June wrote: > How do I make Python press a button on a webpage? I looked at > urllib, but I only see how to open a URL with that. I searched > google but no...
2
by: COHENMARVIN | last post by:
I am working on an application where the user enters info into a multiline textbox. The info is Stylesheet tags that he wants web pages to use. Basically he would be entering a stylesheet into...
5
by: Ben | last post by:
Hi All, User click on a Web Button. -->.....Some code to do something.... --->Then a webpage opened in different Target Window How can I do that? What codes I should use? Thank you, Ben
4
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I...
3
by: nektir | last post by:
i've never used a root link like this with a button, so perhaps this is why i've never encountered a problem.. but how would one fix this: <input name="Go to this webpage" type="button" value="Go...
1
by: =?Utf-8?B?TmFt?= | last post by:
ASP.NET 1.1.4322 Server1: Windows Server Enterprise Ed 2003 – SP2 Server2: Same as Server 1. IE 6.0 –SP2 After we migrated our website from server1 to server2 everything works fine accept...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.