Solved

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

Posted on 2016-09-18
4
31 Views
Last Modified: 2016-09-19
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)
0
Comment
Question by:murbro
  • 2
  • 2
4 Comments
 
LVL 12

Expert Comment

by:Ramkisan Jagtap
ID: 41804332
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

0
 

Author Comment

by:murbro
ID: 41804367
Hi. Thanks. Please could you help me with the CSS code.
0
 
LVL 12

Accepted Solution

by:
Ramkisan Jagtap earned 500 total points
ID: 41804375
.txtbx {
    width: 100%;
}
0
 

Author Closing Comment

by:murbro
ID: 41804390
Great. Thanks very much
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now