Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 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 October 18th, 2007, 12:43 AM
Authorized User
 
Join Date: Feb 2007
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Click event in DOM document

Hi All,

I am writing a project in C# using a web browser control. Objective of this project is to automate the browser. I have an element that I want to be clicked automatically. I am using mshtml.IHTMLDocument3 interface to access DOM document and then find the element by ID. Once I do find the element by ID, I cast it to mshtml.IHTMLElement; but when I do that, I get null reference to mshtml.IHTMLElement variable. Therefore, my click method does not work. Please Help. I need this for my job.


mshtml.IHTMLDocument3 doc = (mshtml.IHTMLDocument3)this.LPBrowser.Document.Dom Document;

doc.getElementById("newlink");

mshtml.IHTMLElement a;

a = (mshtml.IHTMLElement)doc; //Casting here but a becomes null

a.click(); //null.click() so this doesn't work


Thanks.

Abdul Asif.


__________________
A.Asif





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to Click Element in DOM document [email protected] C# 2005 1 October 18th, 2007 03:38 AM
How to Click Element in DOM document [email protected] C# 1 October 18th, 2007 03:03 AM
XPath API and DOM Document object nnravi XML 10 May 2nd, 2006 12:24 PM
How to .... Dom Document namitjung PHP How-To 4 July 7th, 2005 12:17 AM
Click Event dkr72 C# 3 December 8th, 2004 06:23 PM





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