How to set dropdown on .aspx page from managed code via DOM
I have a control that is on an .aspx page, but the dynamic code is in a separate project in the page.xaml.cs file.
On the same page as the control, I have:
<asp:DropDownList ID="DropDownAppServer" runat="server" >
In the page.xaml.cs file, I tried to do this:
HtmlElement element = doc.GetElementById( "DropDownAppServer" );
element.SetAttribute( "option", "blah" );
Does not work. Although it works with:
<input type="text" id="Text1" disabled="disabled" value="My Initial Value" />
0
source to share
2 answers