Avatar of Murray Brown
Murray Brown
Flag 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)
ASP.NETVisual Basic.NET

Avatar of undefined
Last Comment
Murray Brown

8/22/2022 - Mon
Ramkisan Jagtap

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

Murray Brown

ASKER
Hi. Thanks. Please could you help me with the CSS code.
ASKER CERTIFIED SOLUTION
Ramkisan Jagtap

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Murray Brown

ASKER
Great. Thanks very much
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23