Solved

Dropdown property is not set correctly in ASP.NET page

Posted on 2013-11-28
5
77 Views
Last Modified: 2014-05-05
The Visible property of a drop-down box is not set correctly in the following line of code:
drpRootCauses.Visible = True

After this line of code, the Visible property is still false, when watched using a breakpoint.
0
Comment
Question by:shanthi_joseph
  • 4
5 Comments
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39686330
Please post the code your are using to define the drop-down box.  You may also be trying to set this before the control has loaded in which case it wouldn't work.
Please also post the code around you trying to set the Visible property
0
 

Author Comment

by:shanthi_joseph
ID: 39688729
The drpRootCauses Visible property is not set correctly. The drpRootCauses Visible property still remains False when the breakpoint is set after this line of code.  Please refer to attachment.

Here is the code that is used to define and use the drop down box:

Protected WithEvents drpRootCauses As System.Web.UI.WebControls.DropDownList

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
.
.
.

            drpRootCauses.Visible = True

            Dim Reader4 As SqlDataReader = sqlGetRootCause.ExecuteReader

            Dim lstNew2 As New ListItem
            lstNew2.Text = ""
            lstNew2.Value = ""
            drpRootCauses.Items.Add(lstNew2)

            While Reader4.Read()
                Dim lstNew3 As New ListItem
                lstNew3.Text = Reader4.Item(0)
                lstNew3.Value = Reader4.Item(0)
                drpRootCauses.Items.Add(lstNew3)
            End While
            Reader4.Close()
drpdownPropertyNotSet.bmp
0
 

Author Comment

by:shanthi_joseph
ID: 39689048
There is another property namely divRootCause.Visible that was set to False. The divRootCause tag contains the drpRootCause drop down. The problem was fixed when I set both the Visible property of the div and drop down control to True.
0
 

Accepted Solution

by:
shanthi_joseph earned 0 total points
ID: 40033836
I do not require a solution to this problem.
0
 

Author Closing Comment

by:shanthi_joseph
ID: 40041606
I do not require a solution to this problem.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

708 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

13 Experts available now in Live!

Get 1:1 Help Now