473,778 Members | 1,934 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2694


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.webbrowse r.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*****@verizo n.netwrote in message
news:aqiKg.672$ %75.192@trnddc0 5...
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*******@yaho o.dewrote in message
news:%2******** ********@TK2MSF TNGP02.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.webbrowse r.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*****@verizo n.netwrote in message
news:aqiKg.672$ %75.192@trnddc0 5...
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
1260
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 error: Parser Error Message: Only Content controls are allowed directly in a content page that contains Content controls. However, if I place the script in the Master Page, the script works fine.
1
1310
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 how do a) create the messagebox then b) interprate the click i understand i need to do this in javascript, all the tutorials ive read are
0
1622
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 as it is in vb form.............. eagerly waiting for ur reply thanks in advanced for ur guidance
3
14782
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 section not head or body section so, where I use this java script in content page to validate the form. Thanks
0
947
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" name="timestamp" value=""/> <a href="javascript:show_calendar('document.form1.ContentPlaceHolder1.timestamp',document.form1.ContentPlaceHolder1.timestamp.value);"><img src="cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the...
1
2747
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 to .asmx web service reference and write javascript code to call that service on client event. (onchange of a dropdownlist).. it works but when i do the same thing in a content page with the a master page which also have a script manager that refer...
2
8106
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 str=document.getElementById("TextBox1").value; or even if it's inside a form var str=form1.TextBox1.value;
1
3884
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 this <HTML> tag, let's say, I have a lots of JavaScript code along with the HTML code, say <script> ..... </script> and also have inline javascript references , say , <input type = "text" name = "ok" value = "2" onclick=onClick="javascript:...
2
3574
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 and one English. When a user enters a Spanish word in textbox1 and clicks the button, the meaning of the word appears in textbox2. Now sometimes a user enters a word that is not in the database. I want, in this case, to have a javascript messagebox...
0
9629
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9465
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10296
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10127
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10068
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9923
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2863
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.