IT Community - Software Programming, Web Development and Technical Support

ASP.net threading issue when populating a listbox

This is a discussion on ASP.net threading issue when populating a listbox within the ASP and ASP.NET Programming forums, part of the Web Development category; I have started a thread in my web page when clicking a button such that the thread will collect the ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 10-31-2007, 02:50 AM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Smile ASP.net threading issue when populating a listbox

I have started a thread in my web page when clicking a button such that the thread will collect the values to be listed in the listbox but before the threading process completed, the page gets loaded and the values are not binded in the listbox. I have tested the page by breakpoints, the values are added to the listbox perfectly...

Can anybody tell me, how to solve this issue?
__________________
$enthil
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-31-2007, 04:35 AM
it.wily it.wily is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 89
it.wily is on a distinguished road
Default Re: ASP.net threading issue when populating a listbox

I think you have this problem because of the page loaded before all the values are populated in the listbox...

Try using a thread to suspend for some seconds so in that time interval your list is populated, then you can load your page...

Try this code after calling the thread :

Quote:
System.Threading.Thread.Sleep(3000);
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-31-2007, 04:39 AM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Cool Re: ASP.net threading issue when populating a listbox

yes.. its working now.. Is it possible to find whether a thread completes its process or not? means.. termination of a thread...
__________________
$enthil
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-04-2007, 10:52 PM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Smile Re: ASP.net threading issue when populating a listbox

Can anyone tell me how to find the termination of a thread process?

Last edited by $enthil : 11-04-2007 at 10:54 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 11-04-2007, 10:55 PM
it.wily it.wily is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 89
it.wily is on a distinguished road
Default Re: ASP.net threading issue when populating a listbox

do u mean thread termination?

you can use this..

Quote:
thread.abort()
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 11-04-2007, 11:23 PM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Cool Re: ASP.net threading issue when populating a listbox

no.. i didnt mean that...

I am starting a thread from the main class.. after that thread starts the control will come to the next statement and have to wait until the thread completes it process...
__________________
$enthil

Last edited by $enthil : 11-04-2007 at 11:30 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-04-2007, 11:24 PM
it.wily it.wily is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 89
it.wily is on a distinguished road
Smile Re: ASP.net threading issue when populating a listbox

better you can post this as a new thread.. it will be useful to others too....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting specific elements from listbox Kirubhananth ASP and ASP.NET Programming 5 04-08-2008 10:35 PM
How i will get the selected value from Listbox( if selection mode=multiple) Mramesh C# Programming 3 02-07-2008 04:20 AM
Listbox onselected event problem $enthil ASP and ASP.NET Programming 2 11-01-2007 10:36 PM
How to implement threading in VB.Net? amansundar VB.NET Programming 2 10-30-2007 07:41 AM
Threading in C# .Net 2005 : a.deeban C# Programming 53 09-10-2007 07:27 AM


All times are GMT -7. The time now is 08:03 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0