The selected attribute doesn't get updated when you change the selection on the control. It is used to define the item that is selected (default option) when the control is first displayed.
To get the current selection you should invoke the selectedIndex
method to find out which item is selected.
HtmlElement element = webBrowser1.Document.GetElementById("F8");
object objElement = element.DomElement;
object objSelectedIndex = objElement.GetType().InvokeMember("selectedIndex",
BindingFlags.GetProperty, null, objElement, null);
int selectedIndex = (int)objSelectedIndex;
if (selectedIndex != -1)
{
assigneeText.Text = element.Children[selectedIndex].InnerText;
}
If you are using c# 4 you can also use the DLR to avoid having to use reflection.
var element = webBrowser1.Document.GetElementById("F8");
dynamic dom = element.DomElement;
int index = (int)dom.selectedIndex();
if (index != -1)
{
assigneeText.Text = element.Children[index].InnerText;
}