473,943 Members | 14,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MS Internet Controls: Element.getAttr ibute returning System._ComObje ct

I have a AxWebBrowser class. I wish to locate a specific element in its
HTMLDocument which has a specific 'style'.

I use the following code to access the element with the specific
style:-

IHTMLDocument2 doc = (HTMLDocumentCl ass)Browser1.Do cument;
if( doc.body != null && doc.body.all != null)
{
foreach(IHTMLEl ement el in (IHTMLElementCo llection)doc.bo dy.all)
{
if( (el.getAttribut e("style",0) != null) &&
(el.getAttribut e("style",0).To String().ToLowe r() == desiredStyle))
{
System.Windows. Forms.MessageBo x.Show(el.tagNa me);
}
}
}
doc = null;

The code when debugged shows el.getAttribute ("style",0) returning a
System._ComObje ct. I need to cast it to some Type but an unable to do
so. Using reflection all I could find out was thats its an
System.Object with the standard fields and methods defined.

Looking for an answer I scoured the internet and I found a similar
problem mentioned at
http://www.experts-exchange.com/Prog..._21078656.html
but it suggested no answer to the problem.

Any help would be greatly appreciated.

Sep 20 '06 #1
0 1634

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

Similar topics

2
4440
by: Varun Singal | last post by:
Hi I am calling .NET components from my Classical ASPs. For this I strong named my assemblies, then registered them in the resistry ( using RegAsm), and put them in GAC (using GacUtil) . Everything worked fine and my ASPs were able to call and use them. The problem comes when my ASP code assigns an ASP object variable to a property of a class in the assembly like: oDotNetObject("Name") = Request("Name")
2
11995
by: Alvaro G Vicario | last post by:
I need to dynamically remove the onmouseout attribute from a link in an HTML page. I've written code that uses the removeAttribute() method, believing it's a W3C standard. While it works fine in Mozilla, it doesn't work as expected in Internet Explorer 6. If I call the method several times, the first execution returns true and the rest return false, so it's apparently doing something. However, the attribute is still there: hovering the...
3
3487
by: duff | last post by:
Hiya, I'm trying to replace the commented out code below with a neater version using the IAttributeAccessor interface (so that I don't have to write 'if' statements for all control types). At the moment this doen't work. The test line I put in (string s = ControlAttributes.string s = ControlAttributes.GetAttribute ("Text");
5
3531
by: Amelyan | last post by:
How can I get state of dynamically created controls (RadioButton, CheckBox, TextBox.Text) on post back when I click submit button? The only way I know is by traversing Response.Form enumberator; Response.Form.GetEnumerator(), etc. while, identifying specific controls by programmatically assigned unique id (e.g. MyButton_AnswerID_123). However, I am not sure if that is the proper way. What is the common practice?
13
3253
by: Noa | last post by:
Hi I have a page that looks like that: <form name="kuku1" action ="anotherpage.html" > <input name="name"> <input name="kuku2"> </form> As far as i know, "getAttribute" should return a string value of an
2
5342
by: Mara Guida | last post by:
Hi, After I've populated a page with some <INPUT ...> elements I'd like to have access to whatever is written there. The best I've done (which does not work) is: ================ // ==UserScript== // @name AddInput
2
55509
by: yawnmoth | last post by:
Say I have two input elements and that I wanted to make it so that when the first ones input was what it should be, the focus would automatically be shifted to the next input element. ie. something like... <input onkeyup="if (this.value.length == this.maxlength) document.forms.elements.focus()" value="whatever" maxvalue="x" type="text" /> <input value="whatever" maxvalue="x" type="text" />
3
32943
by: Mister Joe | last post by:
I have a page and if the user has javascript enables I am trying to dynamically change a link to a sitemap to a dropdown menu (that when the option is changed will forward the user to another page). Here's the code try{ var sel = document.createElement("select"); sel.setAttribute("onchange", "alert('');");
9
7745
by: Etayki | last post by:
Hi! I am new to VB.net and I am using the Visual Basic 2005 Express Edition I have two questions: 1. I am trying to write an application that will automate Internet Explorer and store data in a database. Am I better off learning VB.net or C#.net? Is there a free development environment for C# as well?
0
10138
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
9970
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
11537
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...
1
11300
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,...
1
8222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7391
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
6310
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4512
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3513
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.