Populate DropDownList from XmlDataSource

后端 未结 3 634
囚心锁ツ
囚心锁ツ 2021-01-21 20:06

I\'d like to populate my DropDownList using a simple xml file:



  foo         


        
3条回答
  •  醉梦人生
    2021-01-21 20:31

    I had the same problem today. My solution:

    This is my xml:

    
    
    
      
        bulbassaur 
      
      
        chamander 
      
      
         squirtle 
      
    
    

    And I put DataTextField="itemname" on the DropDownList server control. ex:

    
    

    It's working without problems. Probably not the best solution,... but at least better than System.Web.UI.WebControls.XmlDataSourceNodeDescriptor.

提交回复
热议问题