Wrox Programmer Forums
|
.NET 4 and Visual Studio 2010 General Discussions For discussing anything about .NET 4, WPF, WCF, the rest of the .NET 4 Framework, and Visual Studio 2010 that isn't about a specific Wrox book. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET 4 and Visual Studio 2010 General Discussions section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 28th, 2012, 09:16 AM
Registered User
 
Join Date: Sep 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Visual Basic 2010 - Click a button on a website

Code:
<a id="ctl00_ContentPlaceHolder_TabStrip_Tab3" href="javascript:__doPostBack('ctl00$ContentPlaceHolder$TabStrip','ctl00$ContentPlaceHolder$TabStrip$Tab3')" style="z-index: 8;">
<span class="wrap">
<span class="innerWrap">Network</span>
can anyone assist? I'm trying to click the button above.

Thank you
 
Old September 28th, 2012, 10:03 AM
Authorized User
 
Join Date: Mar 2012
Posts: 59
Thanks: 2
Thanked 4 Times in 4 Posts
Default

Hi,

I am probably not the one to answer your question in full but to begin with let me give you some advice so the professionals of this forum may respond:-

1) Your post makes no sense. When you say "click button above" I assume you mean the Link above since I cannot see any button here and you have used an <a>etc</a> structure. Even this structure is incorrect since you are missing the closing </a> tag.

2) I also notice that you have not correctly closed off other tags and therefore you are going to get multiple errors anyway.

3) Overall the biggest issue with your post is that you have not explained what the issue is that you are having. You have said that "I'm trying to click the button above" but what does that mean? Do you want to make a cup of tea? Do you want to display some data? what?

It seems that you are trying to run some JScript from this link (this is where I am not qualified to help you) but you have to explain this in full for someone to help you further.

Good luck,

Ian
 
Old September 28th, 2012, 10:21 AM
Registered User
 
Join Date: Sep 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i'm creating an application that will automatically launch a website and click a button on that website.

Also here's more of the code.

Code:
div class="levelwrap level1" style="display: block;">
<ul>
<li class="first">
<li>
<li>
<a id="ctl00_ContentPlaceHolder_TabStrip_Tab3" href="javascript:__doPostBack('ctl00$ContentPlaceHolder$TabStrip','ctl00$ContentPlaceHolder$TabStrip$Tab3')" style="z-index: 8;">
<span class="wrap">
<span class="innerWrap">Network</span>
screens a screeshot of the button on the website and the code.


http://i48.tinypic.com/2ue2mo2.jpg

http://i49.tinypic.com/euonex.png
 
Old September 28th, 2012, 11:45 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It's still pretty unclear what you're trying to accomplish. For example, what do you mean with:

Quote:
an application that will automatically launch a website
Are you trying to open another web site from your application (which I assume is also a web application)? If so, a simple href would do the trick:

<a href=http://othersite.com/" target="_blank">Open other site</a>

If the newly opened window is on a different domain, you cannot use JavaScript to simulate a click on that site; that would be a major security risk.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old September 28th, 2012, 01:47 PM
Registered User
 
Join Date: Sep 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok...

I have an application called FM Audit which tracks meter readings off of printers. The installation is very simple and launches a localhost page after the installation. On this page it requires you to goto a network sub page and enter an ip range. I would like to automate this process because of how simple it is.

Ive managed to have my app open the .exe, install the .exe, open the page but i cannot get my vb app to click on network "button"

If i can get my vb app to click this button, this will save a great amount of time.
 
Old September 28th, 2012, 02:44 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I don't think that'll work due to browser security restrictions.

What you could do is emulate the postback by executing an HTTP request to the site from your VB.NET application. You can execute a POST request and send in the required data.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old September 28th, 2012, 03:06 PM
Registered User
 
Join Date: Sep 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Imar but i am not that yet advanced to figure out how to do that. I am scheduled for a class labeled "Programming in Visual Basic with Microsoft Visual Studio 2010" next month.

Hopefully in the future i will reach that level. Any recommendations by the way?
 
Old September 28th, 2012, 03:27 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Google for "execute post request .net" and the first page with results shows you a number of good and easy to follow examples, such as this one: http://www.clevercomponents.com/arti.../httppost2.asp

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Updated Book Available for Visual Basic 2008/2010? PhillipNash BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 January 4th, 2012 06:55 PM
Beginning Visual Basic 2010 and Microsoft Access QIBusinessGroup BOOK: Beginning Microsoft Visual Basic 2010 4 August 3rd, 2011 09:14 PM
Execute visual basic .exe from Classic ASP website. Nishapd Classic ASP Basics 0 August 28th, 2010 09:55 AM
Visual Basic 2010 WebBrowser & NavigateError keithfrench Visual Basic 2010 General Discussion 0 July 29th, 2010 06:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.