Solved

Dropdown property is not set correctly in ASP.NET page

Posted on 2013-11-28
5
81 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 43

Expert Comment

by:Rob
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Search on a site 5 131
Error viewing ASP page 12 176
Migrate Application To New Mac 5 62
Unwanted Popup 8 136
Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
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…

685 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