Problem with Making DataList work

burak

Well-known member
Joined
Jun 17, 2003
Messages
127
Hello,

I am trying to convert an asp page to asp.net.

In the asp page, there is a table with each row
having a "Required/Preferred" drop down list followed
by a skill description.

Do While not rsData.EOF
response.write("<tr>" + vbCrLf )
response.write("<td class=""left"">" + vbCrLf )
response.write(" <select name=""knowledge-" +
rsData("elementid") + """>" + vbCrLf )
response.write("<option value=""na"">N/A</option>" +
vbCrLf )
response.write("<option value=""required"">
Required</option>" + vbCrLf )
response.write("<option value=""preferred"">
Preferred</option>" + vbCrLf )
response.write("</select>" + vbCrLf )
response.write("</td>" + vbCrLf )
response.write(" <td class=""left"">" + vbCrLf )
response.write(rsData("description") + "" + vbCrLf )
response.write(" </td>" + vbCrLf )
response.write(" </tr>" + vbCrLf )
rsData.MoveNext
Loop
response.write("</table>" + vbCrLf )
end if

Here is the .net code I wrote to mimic that page:

<asp:datalist id="dtList1" runat="server"
DataSource="dSet">
<ItemTemplate>
<table>
<tr>
<td>
<select id="lstKnowldge">
<option value="na">N/A</option>
<option value="required">Required</option>
<option value="preferred">Preferred</option>
</select>
</td>
<td>

<%#DataBinder.Eval(Container.DataItem,"center_desc")%>
</td>
</tr>
</table>
</ItemTemplate>
</asp:datalist>

I copied the DataBinder related code from a book, but
it is not working and I am not sure if I am on the
right track or not.

- How can I have the drop down list have a unique id
each time?

- How can I tie the dataset value to the description
field?

Thank you,

Burak
 
Back
Top