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

Calling Javascript from WinForms WebBrowser

TheServant
1,168 Expert 1GB
Hi all,
I have read a few articles on the subject, but I can't get this one to work. I am trying to automate a simple program to press a couple buttons on a webpage. The webpage however has everything in Javascript, so the button I am trying to press has the html tag:
Expand|Select|Wrap|Line Numbers
  1. <a href="#" class="send_button" onclick="w(this).call('sendLoad', '27196', 'normal', 5);">Send</a>
I have worked out it is calling the Javascript function:
Expand|Select|Wrap|Line Numbers
  1. w.call('getPage',action,options.form.id)
That function is in a resource, and not explicitly visible on the html page.

I have been trying to submit this from C# when loaded in a WebBrowser control using the following:
Expand|Select|Wrap|Line Numbers
  1. private object MyInvokeScript(string name, params object[] args)
  2.         { 
  3.             return this.webBrowser.Document.InvokeScript(name, args); 
  4.         }
  5.  
  6.         private void CallScripts()
  7.         {
  8.             this.MyInvokeScript("w.call", "sendLoad", "27196", "normal", 5);
  9.         }
But without any feedback, I have no idea if I'm even on the right track. This is more from my lack of understanding of Javascript, so is there anyone who has done this before, or can see where I am going wrong?
Feb 27 '12 #1
1 2699
TheServant
1,168 Expert 1GB
Nevermind, gave up and spoke to IT. They did what I thought and said I wasn't allowed to do that. Thanks anyway.
Feb 28 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: ask josephsen | last post by:
Hi NewsGroup Hope you can help me with this. I'm using the "System.Windows.Forms.WebBrowser" to display a various markuplanguage. And it works fine pointing the "WebBrowser.Url" to a local or...
5
by: Krishna | last post by:
Hi all, Can i call my javascript functions from the web controls.Any appropriate site which will be tell more on this will be helpfull. Regards.., Krishna
6
by: szabelin | last post by:
Hello, I am trying to call a function inside the javascript block from asp.net during the postback (NOT button's OnClick event handler though). The javascript function creates new popup window. I...
10
by: Bishoy George | last post by:
// I wrote the following code but it is not working. // Any help please? // ------------------------------------------------ using System; using System.Collections; using System.ComponentModel;...
4
by: Martin Feuersteiner | last post by:
Dear Group I'm using VB to write an aspnet application. I would like to call a javascript function from within a VB Sub or VB Function, is it possible? My code is something like this: VB...
0
by: kal | last post by:
Hi there I am hunting for way to turn off/disable active scripting especially javascript in my webbrowser control. I don't see any property to turn off script. I found entry in registry...
1
by: archcool | last post by:
hi iam new to php and i need help in my php file i have written php code and as well javascript code.the php code displays a form and i need to validate the fields present in the form calling a...
0
by: smithse | last post by:
Hello All, This is my very first posting on bytes!! Here's my "challenge": I have a winforms app (vb.net - 2008) that has a form with the webbrowser control (ie) on it. The page which I am...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
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
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...

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.