asp.net - How to set dropdownlist in .aspx page from managed code via DOM -


I have a control that sits in the .aspx page, but the dynamic code

On the same page as the control, I have:

  & lt; Asp: DropDownList ID = "DropDownAppServer" runat = "server" & gt;  Page.xaml.cs  I have tried to:  
  HtmlElement element = doc.GetElementById ("DropDownAppServer"); Element.SetAttribute ("Option", "Blow");  

Not working though it works with:

  & lt; Input type = "text" id = "text1" disabled = "disabled" value = "my initial value" />  

Can not you tell why you are not

  DropDownAppServer.Option = blah?  

If you do not have explicit access to control, you can use the FindControl (ctrlName) function to get context for children's objects.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -