Click here to Skip to main content
15,878,945 members
Home / Discussions / C#
   

C#

 
GeneralRe: graphics Pin
CWIZO1-May-06 21:23
CWIZO1-May-06 21:23 
GeneralRe: graphics Pin
cshivaprasad1-May-06 21:32
cshivaprasad1-May-06 21:32 
GeneralRe: graphics Pin
CWIZO1-May-06 21:35
CWIZO1-May-06 21:35 
GeneralRe: graphics Pin
cshivaprasad1-May-06 23:41
cshivaprasad1-May-06 23:41 
GeneralRe: graphics Pin
CWIZO1-May-06 23:45
CWIZO1-May-06 23:45 
GeneralRe: graphics Pin
cshivaprasad2-May-06 0:08
cshivaprasad2-May-06 0:08 
QuestionDerived CollectionBase Class overwriting previous entries. Pin
Steven_Henley1-May-06 20:24
Steven_Henley1-May-06 20:24 
QuestionWebBrowser / HtmlElement Class Help Pin
joetoday1-May-06 19:32
joetoday1-May-06 19:32 
I’m new to .NET and HTML programming …

I’m trying to automatically (programmatically) select an entry in a HTML table. I’m using C# and .NET and the WebBrowser Class.

I can automatically log in by doing

HtmlElement userElem = doc.GetElementById("signin:user");
userElem.InnerText = this.m_username.Text;
HtmlElement pwElem = doc.GetElementById("signin:password");
pwElem.InnerText = this.m_password.Text;
HtmlElement btnElem = doc.GetElementById("signin:signinbtn");
btnElem.InvokeMember("click");

I have a table I need to process which looks like:


<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td class="TopBorder"></td>
<td class="TopBorder" align="right" width="1000"></td>
<td class="TopBorder" vAlign="top" align="right" width="1"></td>
</tr>
<tr height="6">
<td></td>
</tr>
<TR>
<TD vAlign="top" width="1" rowSpan="3">

<SELECT size="2" onchange="UpdateTable(event)" style="FONT-SIZE: xx-small; WIDTH: 200px; font-family: Verdana, Helvetica, sans-serif;"
id="lbInList">

<OPTION style="BACKGROUND-COLOR: LemonChiffon" value="303294000">OPTION 1 </OPTION>

<OPTION style="BACKGROUND-COLOR: PaleGreen" value="366779420">OPTION 2 </OPTION>

</SELECT>
</TD>
</TR>
</TABLE>


Ive tried but get no selection: Any ideas what i'm doing wrong?

HtmlElement Table = doc.GetElementById("Table1");
HtmlElement Info = doc.GetElementById("lbInList");

Info.SetAttribute("value", "303294000");
Info.InvokeMember("select", "1");

AnswerRe: WebBrowser / HtmlElement Class Help Pin
leppie1-May-06 20:25
leppie1-May-06 20:25 
GeneralRe: WebBrowser / HtmlElement Class Help Pin
joetoday2-May-06 11:35
joetoday2-May-06 11:35 
Questionreading a file in C# Pin
leanhsang1-May-06 17:36
leanhsang1-May-06 17:36 
AnswerRe: reading a file in C# Pin
CWIZO1-May-06 21:23
CWIZO1-May-06 21:23 
AnswerRe: reading a file in C# Pin
stancrm1-May-06 23:21
stancrm1-May-06 23:21 
QuestionDocument Properties Pin
smarttom991-May-06 17:16
smarttom991-May-06 17:16 
QuestionRecommendation Pin
John L. DeVito1-May-06 15:05
professionalJohn L. DeVito1-May-06 15:05 
AnswerRe: Recommendation Pin
Michael A. Barnhart1-May-06 15:17
Michael A. Barnhart1-May-06 15:17 
AnswerRe: Recommendation Pin
Al Ortega1-May-06 15:56
Al Ortega1-May-06 15:56 
AnswerRe: Recommendation Pin
Joe Woodbury1-May-06 18:14
professionalJoe Woodbury1-May-06 18:14 
QuestionChanging Order of Items in a Bound ListBox Pin
myNameIsRon1-May-06 12:25
myNameIsRon1-May-06 12:25 
AnswerRe: Changing Order of Items in a Bound ListBox Pin
Josh Smith2-May-06 1:30
Josh Smith2-May-06 1:30 
GeneralRe: Changing Order of Items in a Bound ListBox Pin
myNameIsRon2-May-06 16:05
myNameIsRon2-May-06 16:05 
QuestionData Grid - Setting Current Column and arrow key capture Pin
Michael A. Barnhart1-May-06 12:15
Michael A. Barnhart1-May-06 12:15 
QuestionDLL question Pin
Tom Wright1-May-06 12:12
Tom Wright1-May-06 12:12 
AnswerRe: DLL question Pin
Robin Panther1-May-06 13:07
Robin Panther1-May-06 13:07 
QuestionPassportIdentity.Compress - ?? Pin
BlackDice1-May-06 11:23
BlackDice1-May-06 11:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.