Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

ASP.net VB.net Set width of progrematically added DropDownList to 100%

Hi. The third line in my VB.net code in ASP.net does not set the width of the DropDownList to 100%

                     Dim ddl As New DropDownList
                        ddl.ID = oControlName
                        ddl.Attributes.Add("width", "100%")
                        Me.Panel_Controls.Controls.Add(ddl)
Avatar of Ramkisan Jagtap
Ramkisan Jagtap
Flag of Finland image

create a css class for dropdownlist. Set width to 100% in that call and set css class in your code


   
                       Dim ddl As New DropDownList
                       ddl.ID = oControlName
                       ddl.CssClass="YourCssClass"
                       Me.Panel_Controls.Controls.Add(ddl)

Open in new window

Avatar of Murray Brown

ASKER

Hi. Thanks. Please could you help me with the CSS code.
ASKER CERTIFIED SOLUTION
Avatar of Ramkisan Jagtap
Ramkisan Jagtap
Flag of Finland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great. Thanks very much