473,386 Members | 1,823 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,386 software developers and data experts.

Read Javascript Messagebox content from webclient

Does anyone know how I might use the webclient class to navigate to a web
page in a vb.net app, and then if a JavaScript popup appears from the web
page I go to, read the message in it or content of it, then close it so I
can continue on.
I don't know how to reference the popup box or send a command to click the
ok button to close it.
Mike Duclon
Sep 2 '06 #1
4 2678


Michael Duclon wrote:
Does anyone know how I might use the webclient class to navigate to a web
page in a vb.net app, and then if a JavaScript popup appears from the web
page I go to, read the message in it or content of it, then close it so I
can continue on.
I don't know how to reference the popup box or send a command to click the
ok button to close it.
WebClient does a HTTP request and fetches the HTTP response for you but
it does not know anything about HTML documents or HTML documents with
JavaScript.
If you want to render a HTML document like a browser does then in .NET
2.0 you have the WebBrowser control
<http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx>
I am not sure however there is a way then from .NET to close JavaScript
alert dialogs.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Sep 2 '06 #2
When you request the page using the webclient classes, the remote server
sends the page back as a response. It does not undertsand html or
javascript and will not actually run the page for you as a browser would, in
short you have the resulting HTML as if you did a view source from within a
browser..

Regards

John Timney (MVP)
"Michael Duclon" <md*****@verizon.netwrote in message
news:aqiKg.672$%75.192@trnddc05...
Does anyone know how I might use the webclient class to navigate to a web
page in a vb.net app, and then if a JavaScript popup appears from the web
page I go to, read the message in it or content of it, then close it so I
can continue on.
I don't know how to reference the popup box or send a command to click the
ok button to close it.
Mike Duclon

Sep 2 '06 #3
thanks Martin, I've decided to try and use the WebBrowser control.
I'm looking at it to see if I can figure out how to close the javascript
window using that route. It seems like I should be able to access it from
the document object.
If anyone has any thoughts on that or has tried this please let me know, and
if I find the answer I will post back.

Michael Duclon

"Martin Honnen" <ma*******@yahoo.dewrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>

Michael Duclon wrote:
>Does anyone know how I might use the webclient class to navigate to a web
page in a vb.net app, and then if a JavaScript popup appears from the web
page I go to, read the message in it or content of it, then close it so I
can continue on.
I don't know how to reference the popup box or send a command to click
the ok button to close it.

WebClient does a HTTP request and fetches the HTTP response for you but it
does not know anything about HTML documents or HTML documents with
JavaScript.
If you want to render a HTML document like a browser does then in .NET 2.0
you have the WebBrowser control
<http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx>
I am not sure however there is a way then from .NET to close JavaScript
alert dialogs.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Sep 2 '06 #4
Here is a link to an article that explain a bit about blocking popups by
extending the .NET 2.0 WebBrowser control:

http://www.codeproject.com/csharp/Ex...WebBrowser.asp

--
Mike

Mike McIntyre [MVP]
http://www.getdotnetcode.com
"Michael Duclon" <md*****@verizon.netwrote in message
news:aqiKg.672$%75.192@trnddc05...
Does anyone know how I might use the webclient class to navigate to a web
page in a vb.net app, and then if a JavaScript popup appears from the web
page I go to, read the message in it or content of it, then close it so I
can continue on.
I don't know how to reference the popup box or send a command to click the
ok button to close it.
Mike Duclon

Sep 4 '06 #5

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

Similar topics

0
by: Steven K | last post by:
Hello, I have a Master Page with ContentPlaceHolders. I also have a content page which I need to add some JavaScript to. If I place the JavaScript in the content page, I get the following...
1
by: Mike Fellows | last post by:
ive read a few tutorials, but i cant get my head round it, all i need is a messagebox that displays "update" "new" on update i want it to update a record, on new i want it to create a new record...
0
by: russel | last post by:
how to read the text content of the html file in vb6 .... the html is already stored in a particular folder...... the html file contains the details in tabular format which r to be read & copied...
3
by: bbawa1 | last post by:
Hi, I have a master page and content page. In content page I have to validate the text boxes for name,address, phone number and email address etc. But as content pages doersn't have html...
0
by: kewldudehere | last post by:
Hi folks, I have a content Page and have the following Code in the content tag. <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <input type="Text"...
1
by: guoyuanliu | last post by:
Hi, I have a problem with calling javascript function that will call web service fin ASP.NET AJAX. This is the description: When i use one page (.aspx) i place a script manager that reference...
2
ThatThatGuy
by: ThatThatGuy | last post by:
There's this aspx page proabably a content page.... There's a provision where i need to access a textbox (ASP or HTML Server) value can't access it in content page even if i do var...
1
by: shivsa | last post by:
Hi Experts, I have a simple Perl code, in this, I have a Perl variable , say $original = '<html>..........................................................................<html>' in between...
2
by: bassemG | last post by:
This program in asp.net 2.0 is a Spanish/English Dictionary. It consists of two textboxes,one button and a datalist. The datalist is bound to an acces database consisting of two columns; One Spanish...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.