I have an ASP.NET control, for example a DropDownList. I want to set the width of the control to auto
. How do I achieve this? The Width
property in ASP.NET control does not seem to accept auto
, but it can only accept like percentage, pixels, and points.
I know I can make some workaround by specifying style="width:auto"
as the control's attribute, and as this attribute is not a valid attribute for the control, it will not be parsed by asp.net and hence passed directly to browser. Is there a more proper way to do this?