Using the following Eval script for setting ID property causes error. Error message: the server tag is not well formed.
<asp:Panel runat="server" ID="<%# Eval("RENTER_ID") %>" Visible="false">
Even replacing "" with '' of ID property generates error. While using '', its error message
"The ID property of a control can only be set using the ID attribute in the tag and a simple value. Example: <asp:Button runat="server" id="Button1" />
"
Any ideas to solve this?
You can't do it.
Why do you need to? If it's so you can reference it at some point, you can access the client-side id via the property ClientID.
Example, as requested:
As Silky said, you can't do this. The attributes can't be dynamic in none code behind. One solution is to subclass the Panel:
asp.net controls' ID doesn't support the binding. Try to use HTML controls to work around.
Do you need to use a panel? Could you just use html?
Try this
Try this - It will not popup any messages if you do formatting, but it will show Design time error.
It almost always when asp.net fails , comes Jquery into the field to set the situation up ;) . you can do this trick for example :
In HTML:
Jquery: