我这样使用是好使的:
(1)string [] m_aryStr = new string [] {"abc", "def", "ghi", "jki"} ;
(2)Draw a datalist1 on a Web form and set datalist1.datasource = m_aryStr ;
(3)Drag dropdownlist1 into datalist1(when designing the template) and right click dropdownlist1 to get the property dialog. set the databinding property of dropdownlist1 , make "datasource" the bindable property and bind container.dataitem to datasource.
(4)end the design of template
(5) call databind() in page_load().
(6) ok now
(1)string [] m_aryStr = new string [] {"abc", "def", "ghi", "jki"} ;
(2)Draw a datalist1 on a Web form and set datalist1.datasource = m_aryStr ;
(3)Drag dropdownlist1 into datalist1(when designing the template) and right click dropdownlist1 to get the property dialog. set the databinding property of dropdownlist1 , make "datasource" the bindable property and bind container.dataitem to datasource.
(4)end the design of template
(5) call databind() in page_load().
(6) ok now