Click here to Skip to main content
15,905,614 members
Home / Discussions / C#
   

C#

 
QuestionData Query Pin
Sean8926-Apr-06 11:33
Sean8926-Apr-06 11:33 
AnswerRe: Data Query Pin
Kayess Tech26-Apr-06 11:42
professionalKayess Tech26-Apr-06 11:42 
GeneralRe: Data Query Pin
Sean8926-Apr-06 11:48
Sean8926-Apr-06 11:48 
GeneralRe: Data Query Pin
Rob Graham26-Apr-06 12:32
Rob Graham26-Apr-06 12:32 
GeneralRe: Data Query Pin
Sean8926-Apr-06 12:50
Sean8926-Apr-06 12:50 
AnswerRe: Data Query Pin
Kuira26-Apr-06 14:10
Kuira26-Apr-06 14:10 
GeneralRe: Data Query Pin
Sean8926-Apr-06 14:29
Sean8926-Apr-06 14:29 
QuestionApplication Focus Pin
Kayess Tech26-Apr-06 11:30
professionalKayess Tech26-Apr-06 11:30 
AnswerRe: Application Focus Pin
Shajeel26-Apr-06 19:11
Shajeel26-Apr-06 19:11 
GeneralRe: Application Focus Pin
Kayess Tech28-Apr-06 0:26
professionalKayess Tech28-Apr-06 0:26 
Questionspeech marks in the registry key Pin
IAmChris26-Apr-06 11:10
IAmChris26-Apr-06 11:10 
AnswerRe: speech marks in the registry key Pin
likefood26-Apr-06 11:16
likefood26-Apr-06 11:16 
GeneralRe: speech marks in the registry key Pin
IAmChris26-Apr-06 11:42
IAmChris26-Apr-06 11:42 
QuestionClip Rectangle - Cursor Pin
codebala26-Apr-06 10:57
codebala26-Apr-06 10:57 
AnswerRe: Clip Rectangle - Cursor Pin
Ed.Poore26-Apr-06 11:53
Ed.Poore26-Apr-06 11:53 
QuestionHelp require on transfering sms and video(MMS) from pc to mobile using SIP protocol Pin
kashif.qau26-Apr-06 10:41
kashif.qau26-Apr-06 10:41 
QuestionHtmlElement.OuterHtml.Replace(­) fails with COM exception Pin
cweeks7868126-Apr-06 10:28
cweeks7868126-Apr-06 10:28 
I've tried asking this on microsoft.public.dotnet.languages.csharp, but I am getting no response. Maybe I'm getting lost in the traffic. So, let's try it here.

Dev env: VS 2005 C# Express, .Net Framework 2.0

I am trying to programmatically select an item in a listbox on a web page. The first thing I do is go through and de-select any selected items. The OuterHtml field of a selected element in the listbox looks something like this:

Default item

I want to simply remove the the term 'selected' this way:

elt.OuterHtml = elt.OuterHtml.Replace("selected","");

This results in OuterHtml being set to:



Notice: 1) the 'selected' term is untouched, 2) the visible text has been removed.

After the assignment I can see in the debugger that one of the members of the HtmlElement object (OffsetParent, I think) has a string indicating some kind of COM Interop services exception.

The MSDN documentation at

http://tinyurl.com/edbln

does contain this warning:

"If you assign a new value to OuterHtml, the current element reference will become invalid; it will not reflect the name, properties and child content of the HTML you have just assigned."

but I don't really understand what that means.

Is it possible to change the HTML in a web page? Am I going about it the wrong way? Is there some kind of initialization or setup call I am supposed to make? Is it just a bug in .NET 2.0?
GeneralRe: HtmlElement.OuterHtml.Replace(­) fails with COM exception Pin
Guffa26-Apr-06 10:39
Guffa26-Apr-06 10:39 
GeneralRe: HtmlElement.OuterHtml.Replace(­) fails with COM exception Pin
cweeks7868126-Apr-06 10:49
cweeks7868126-Apr-06 10:49 
QuestionHow to read a file that is always written to? Pin
pistolenpaultje26-Apr-06 10:17
pistolenpaultje26-Apr-06 10:17 
AnswerRe: How to read a file that is continuedly written to? Pin
Guffa26-Apr-06 10:32
Guffa26-Apr-06 10:32 
GeneralRe: How to read a file that is continuedly written to? Pin
pistolenpaultje26-Apr-06 10:43
pistolenpaultje26-Apr-06 10:43 
GeneralRe: How to read a file that is continuedly written to? Pin
Ed.Poore26-Apr-06 12:30
Ed.Poore26-Apr-06 12:30 
AnswerRe: How to read a file that is continuedly written to? Pin
Office Lineman26-Apr-06 10:39
Office Lineman26-Apr-06 10:39 
GeneralRe: How to read a file that is continuedly written to? Pin
pistolenpaultje26-Apr-06 10:58
pistolenpaultje26-Apr-06 10:58 

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.