Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2016-09-18
4
Medium Priority
?
76 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:Murray Brown
  • 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:Murray Brown
ID: 41804367
Hi. Thanks. Please could you help me with the CSS code.
0
 
LVL 12

Accepted Solution

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

Author Closing Comment

by:Murray Brown
ID: 41804390
Great. Thanks very much
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

916 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