473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Hidden llist box does not populate

I intend to populate a listBox from the database for later use. (the intent
for doing this is irrelevant to this questrion)

The list box when hidden is never populated. The list box when visible is
always populatd. How do I populate it even though it remains hidden?

Thanks,
Doug
Jun 27 '08 #1
2 1489
"dbuchanan" <db*******@newsgroup.nospamwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
I intend to populate a listBox from the database for later use. (the
intent for doing this is irrelevant to this questrion)

The list box when hidden is never populated. The list box when visible is
always populatd. How do I populate it even though it remains hidden?
When you say "hidden" do you mean that you are setting the ListBox's Visible
property to false? If so, then the ListBox will not even be rendered to the
client browser...

If you want a webcontrol to be rendered to the browser but not displayed,
then you need to set its "display" attribute to "none" e.g.

MyListBox.Attributes.Add("display", "none");

or

MyListBox.Attributes.Add("style", "display:none;");
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #2
Thanks for Mark's informative input.

Hi Doug,

I also suggest you use the "display" css style to hide the ListBox rather
than use ASP.NET server-side "Visible" property. This is because css style
only hide the client-side html element display, but won't affect the
server-side control's population(or other processing). However, setting
the server-side Visible property will make the control not considered
existing on the page's control collection.

Anyway, the "display" css style is also very useful when you want to use
script to show/hide an certain control/html element on the page.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Mark Rae [MVP]" <ma**@markNOSPAMrae.net>
References: <#P**************@TK2MSFTNGP03.phx.gbl>
In-Reply-To: <#P**************@TK2MSFTNGP03.phx.gbl>
Subject: Re: Hidden llist box does not populate
Date: Thu, 26 Jun 2008 01:09:10 +0100
>
"dbuchanan" <db*******@newsgroup.nospamwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I intend to populate a listBox from the database for later use. (the
intent for doing this is irrelevant to this questrion)

The list box when hidden is never populated. The list box when visible
is
>always populatd. How do I populate it even though it remains hidden?

When you say "hidden" do you mean that you are setting the ListBox's
Visible
>property to false? If so, then the ListBox will not even be rendered to
the
>client browser...

If you want a webcontrol to be rendered to the browser but not displayed,
then you need to set its "display" attribute to "none" e.g.

MyListBox.Attributes.Add("display", "none");

or

MyListBox.Attributes.Add("style", "display:none;");
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Andrew Durstewitz | last post by:
Hi! I am having a really strange issue. I have a few users calling in saying they are getting an error. On further review I found this line is what is causing it... Set strLookup =...
0
by: Bharat Suneja | last post by:
Hi All, I'm running into issues with passing the distinguishedName of a user as a hidden form field in a form from one page to the result page. Page 1: User enters user name in a form field ...
2
by: Patrick | last post by:
I currently us JavaScript to populate a hidden field with my scroll location in order to retain the page location when I post the page back to itself. However, I don't know how to pass that hidden...
6
by: GoCMS | last post by:
Hi, guys: I am trying debug other people(who has left company)'s ASP code, and had difficulty understanding the use of a hidden asp page. The application has an index page, like MyIndex.asp...
4
by: GavMc | last post by:
Hello I am new to internet programming and wonder if anyone can help me with this.... I am trying to pass a hidden field value on a form into another field on the form so that it can then be...
1
by: Wim | last post by:
Hi Everyone, I'm trying to speed up a Asp.net 1.1 applications' performance. The application needs to run in an environment with little bandwith and therefore pagesizes and roundtrip times shoud...
12
by: Alan Silver | last post by:
Hello, I have a page that gets passed an ID in the query string. It then uses this ID to pull info out of a database and populate controls on the page. When the page is posted back, the query...
5
by: Ian Davies | last post by:
Hello I wish to use J.S. to obtain the screen ht and put this value into a hidden field for posting. so that I can then use it in a php file. A simplified script of what I am trying to do is...
2
by: Alexio | last post by:
Sample code snippet - <td align="right">Check Amount:&nbsp;</td> (1) <td><input type="text" name="CHK_input_1" size="19"style="text-align:right" onkeyup="calcCB();"...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.