Hi, I am trying to put a dropdown list of choices into the <InsertItemTemplate> of a DetailsView. I have an MySQL database and thus retrieving the set value for the drop down list from the database table. I have put the DropDownList on the page and it works correctly, but when trying to put it into the TemplateField, I can't get it to work.
I have used this page as my starting point as it is close to what I want, but it is a gridview instead. http://www.aspsnippets.com/Articles/How-to-bind-data-to-DropDownList-in-GridView-in-ASPNet.aspx Does anyone know an example as similar to above for DetailsView instead. I am after some assistance with the VB code, to be able to insert the dropdown into the DetailsView. I have the separate code in the VB code behind that connects to the database so I know my connections string is correct. Thanks Chris
<InsertItemTemplate>
<asp:Label ID="lblTimes" runat="server" Text='<%# Eval("CourseTime")%>'/>
<asp:DropDownList ID="DropDownList2" runat="server">
</asp:DropDownList>
</InsertItemTemplate>