Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set the html 'name' attriubute of an asp:DropDownList

I have a asp:DropDownList element that I need to reference in my code behind but I need it to have a very specific name that has special characters so I cannot use that as the id.

Is it possible to manually set the name in the .aspx file? When I try to do it now:

The html is rendered with two name attributes.

like image 294
BenMills Avatar asked Nov 15 '22 02:11

BenMills


1 Answers

The name attribute is automatically generated which means you can't set it. But you can access it through the ClientID property of the control.

like image 139
Hna Avatar answered Nov 29 '22 05:11

Hna