I have following code inside my ListView template.
<asp:DropDownList runat="server" ID="myDropDown" Width="60px"
SelectedValue='<%# Eval("SelectedValue") %>'
DataSource='<%# Eval("DropDownList") %>'
style='display:<%# (bool)Eval("ShowDropDown") ? "block" : "none" %>;' >
</asp:DropDownList>
The idea is that it will generate the html, but hidden so I can show the client-side.
However, the html generated looks like this:
<select id="myDropDown"
style="width:60px;display:<%# (bool)Eval("ShowDropDown") ? "block" : "none" %>;">
I don't understand why it does this. Is there a way to do this (without using classes)?