Solved

Dropdown property is not set correctly in ASP.NET page

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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

803 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