Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Hidden llist box does not populate

Reply
Thread Tools

Hidden llist box does not populate

 
 
dbuchanan
Guest
Posts: n/a
 
      06-25-2008
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


 
Reply With Quote
 
 
 
 
Steven Cheng [MSFT]
Guest
Posts: n/a
 
      06-26-2008
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:
http://www.velocityreviews.com/forums/(E-Mail Removed).

==================================================
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]" <(E-Mail Removed)>
>References: <#(E-Mail Removed)>
>In-Reply-To: <#(E-Mail Removed)>
>Subject: Re: Hidden llist box does not populate
>Date: Thu, 26 Jun 2008 01:09:10 +0100


>
>"dbuchanan" <(E-Mail Removed)> wrote in message
>news:%(E-Mail Removed)...
>
>> 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
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
div box questions; float text around a box, fit box to image size Gnarlodious HTML 4 05-05-2010 11:30 AM
Populate Hidden field on post back and retrieve value from Hidden Field Rick ASP .Net 3 04-13-2010 05:38 PM
populate one list box with selected values from another list box steven.cooper@infocision.com ASP .Net 1 03-12-2005 11:29 PM
Populate a popup window with clickable records from an Access DB and upon clicking, populate a selectbox on the original webpage with the clicked record Enjoy Life ASP General 2 02-23-2005 10:48 PM
Populate List Box base on Combo Box Selection Adrian ASP General 1 02-18-2004 09:49 AM



Advertisments