473,623 Members | 3,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multi threading and AJAX

Hi guys,

I have this page that needs to be populated with 2 diferent web services,
and each one takes more or less 10 seconds to finish populate his own part,
so I move on to the multi threading inside ASP.NET.

my questions is:

having a ASP.NET AJAX page and my gridView inside an atlas:UpdatePan el
control how can I update the panel so it shows the datagrid with the results
from the webservice?

Sub callDRService()
Dim dr As New drService
dr.getDRInfoFro mWebService("Jo hn", "Hansen", "Nørregade 86", "5700",
False)
gvDRWarnings.Da taSource = dr.warningTable
gvDRWarnings.Da taBind()
up.Update()
End Sub

the up control is a UpdatePanel, but at the end of the thread the panel
simple wont update :-(

any thoughts?
code for page_load and thread call
-------------------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArg s)
Handles Me.Load
populateDRFromW Service_Thread( )
End Sub
Public Sub populateDRFromW Service_Thread( )
Dim NewThread As Thread = New Thread(AddressO f callDRService)
NewThread.Prior ity = ThreadPriority. Lowest
NewThread.Start ()
End Sub
-------------------------
--

Bruno Alexandre
København, Danmark

"a portuguese in Denmark"


Oct 12 '06 #1
4 2323

Interesting. This is probably not related to AJAX though. It probably is
related to the timing of the thread and the update call. Wrap your bind code
in a null check to make sure data is back before you call the update. That
will eliminate or confirm the timing issue.

if(dr.warningTa ble IsNotNull And dr.warningTable[0].rows.count 0) then
gvDRWarnings.Da taSource = dr.warningTable
gvDRWarnings.Da taBind()
up.Update()
end if

--
_______________ _________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"Bruno Alexandre" <br*********@gm ail.comwrote in message
news:%2******** **********@TK2M SFTNGP05.phx.gb l...
Hi guys,

I have this page that needs to be populated with 2 diferent web services,
and each one takes more or less 10 seconds to finish populate his own
part, so I move on to the multi threading inside ASP.NET.

my questions is:

having a ASP.NET AJAX page and my gridView inside an atlas:UpdatePan el
control how can I update the panel so it shows the datagrid with the
results from the webservice?

Sub callDRService()
Dim dr As New drService
dr.getDRInfoFro mWebService("Jo hn", "Hansen", "Nørregade 86", "5700",
False)
gvDRWarnings.Da taSource = dr.warningTable
gvDRWarnings.Da taBind()
up.Update()
End Sub

the up control is a UpdatePanel, but at the end of the thread the panel
simple wont update :-(

any thoughts?
code for page_load and thread call
-------------------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
populateDRFromW Service_Thread( )
End Sub
Public Sub populateDRFromW Service_Thread( )
Dim NewThread As Thread = New Thread(AddressO f callDRService)
NewThread.Prior ity = ThreadPriority. Lowest
NewThread.Start ()
End Sub
-------------------------
--

Bruno Alexandre
København, Danmark

"a portuguese in Denmark"


Oct 14 '06 #2
the problem remains...
after the page is completed, I can't update anything on it. even an
UpdatePanel :-(

what I did was wait for the 2 threads to finish and then show the page.
with MultiThreading I get the page shows up in aprox 4sec instead of the
9/12 sec before

not what I was searching in the first place - I want to present the page and
a progress bar saying that the webservice call is still running and when it
finish populate the gridview with all the info. but, I coudn't do that
yet... :-(

--

Bruno Alexandre
København, Danmark

"a Portuguese in Denmark"

Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"Alvin Bruney [MVP]" <www.lulu.com/owcwrote in message
news:ed******** ******@TK2MSFTN GP03.phx.gbl...
>
Interesting. This is probably not related to AJAX though. It probably is
related to the timing of the thread and the update call. Wrap your bind
code in a null check to make sure data is back before you call the update.
That will eliminate or confirm the timing issue.

if(dr.warningTa ble IsNotNull And dr.warningTable[0].rows.count 0) then
gvDRWarnings.Da taSource = dr.warningTable
gvDRWarnings.Da taBind()
up.Update()
end if

--
_______________ _________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"Bruno Alexandre" <br*********@gm ail.comwrote in message
news:%2******** **********@TK2M SFTNGP05.phx.gb l...
>Hi guys,

I have this page that needs to be populated with 2 diferent web services,
and each one takes more or less 10 seconds to finish populate his own
part, so I move on to the multi threading inside ASP.NET.

my questions is:

having a ASP.NET AJAX page and my gridView inside an atlas:UpdatePan el
control how can I update the panel so it shows the datagrid with the
results from the webservice?

Sub callDRService()
Dim dr As New drService
dr.getDRInfoFro mWebService("Jo hn", "Hansen", "Nørregade 86", "5700",
False)
gvDRWarnings.Da taSource = dr.warningTable
gvDRWarnings.Da taBind()
up.Update()
End Sub

the up control is a UpdatePanel, but at the end of the thread the panel
simple wont update :-(

any thoughts?
code for page_load and thread call
-------------------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventAr gs) Handles Me.Load
populateDRFromW Service_Thread( )
End Sub
Public Sub populateDRFromW Service_Thread( )
Dim NewThread As Thread = New Thread(AddressO f callDRService)
NewThread.Prior ity = ThreadPriority. Lowest
NewThread.Start ()
End Sub
-------------------------
--

Bruno Alexandre
København, Danmark

"a portuguese in Denmark"



Oct 14 '06 #3
post a short but complete program that demonstrates the problem. Short but
complete programs are defined here:
http://www.yoda.arachsys.com/csharp/complete.html

--
_______________ _________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"Bruno Alexandre" <br*********@gm ail.comwrote in message
news:eB******** ******@TK2MSFTN GP02.phx.gbl...
the problem remains...
after the page is completed, I can't update anything on it. even an
UpdatePanel :-(

what I did was wait for the 2 threads to finish and then show the page.
with MultiThreading I get the page shows up in aprox 4sec instead of the
9/12 sec before

not what I was searching in the first place - I want to present the page
and a progress bar saying that the webservice call is still running and
when it finish populate the gridview with all the info. but, I coudn't do
that yet... :-(

--

Bruno Alexandre
København, Danmark

"a Portuguese in Denmark"

Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"Alvin Bruney [MVP]" <www.lulu.com/owcwrote in message
news:ed******** ******@TK2MSFTN GP03.phx.gbl...
>>
Interesting. This is probably not related to AJAX though. It probably is
related to the timing of the thread and the update call. Wrap your bind
code in a null check to make sure data is back before you call the
update. That will eliminate or confirm the timing issue.

if(dr.warningT able IsNotNull And dr.warningTable[0].rows.count 0) then
gvDRWarnings.Da taSource = dr.warningTable
gvDRWarnings.Da taBind()
up.Update()
end if

--
______________ __________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"Bruno Alexandre" <br*********@gm ail.comwrote in message
news:%2******* ***********@TK2 MSFTNGP05.phx.g bl...
>>Hi guys,

I have this page that needs to be populated with 2 diferent web
services, and each one takes more or less 10 seconds to finish populate
his own part, so I move on to the multi threading inside ASP.NET.

my questions is:

having a ASP.NET AJAX page and my gridView inside an atlas:UpdatePan el
control how can I update the panel so it shows the datagrid with the
results from the webservice?

Sub callDRService()
Dim dr As New drService
dr.getDRInfoFro mWebService("Jo hn", "Hansen", "Nørregade 86", "5700",
False)
gvDRWarnings.Da taSource = dr.warningTable
gvDRWarnings.Da taBind()
up.Update()
End Sub

the up control is a UpdatePanel, but at the end of the thread the panel
simple wont update :-(

any thoughts?
code for page_load and thread call
-------------------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventA rgs) Handles Me.Load
populateDRFromW Service_Thread( )
End Sub
Public Sub populateDRFromW Service_Thread( )
Dim NewThread As Thread = New Thread(AddressO f callDRService)
NewThread.Prior ity = ThreadPriority. Lowest
NewThread.Start ()
End Sub
-------------------------
--

Bruno Alexandre
København, Danmark

"a portuguese in Denmark"




Oct 15 '06 #4
this can't be for me right?
I gave the code, you gave me a response, and then I told what exactly I did
to get arround my problem!

maybe you just miss it.

--

Bruno Alexandre
København, Danmark

"a Portuguese in Denmark"

Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"Alvin Bruney [MVP]" <www.lulu.com/owcwrote in message
news:%2******** *********@TK2MS FTNGP05.phx.gbl ...
post a short but complete program that demonstrates the problem. Short but
complete programs are defined here:
http://www.yoda.arachsys.com/csharp/complete.html

--
_______________ _________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"Bruno Alexandre" <br*********@gm ail.comwrote in message
news:eB******** ******@TK2MSFTN GP02.phx.gbl...
>the problem remains...
after the page is completed, I can't update anything on it. even an
UpdatePanel :-(

what I did was wait for the 2 threads to finish and then show the page.
with MultiThreading I get the page shows up in aprox 4sec instead of the
9/12 sec before

not what I was searching in the first place - I want to present the page
and a progress bar saying that the webservice call is still running and
when it finish populate the gridview with all the info. but, I coudn't do
that yet... :-(

--

Bruno Alexandre
København, Danmark

"a Portuguese in Denmark"

Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"Alvin Bruney [MVP]" <www.lulu.com/owcwrote in message
news:ed******* *******@TK2MSFT NGP03.phx.gbl.. .
>>>
Interesting . This is probably not related to AJAX though. It probably is
related to the timing of the thread and the update call. Wrap your bind
code in a null check to make sure data is back before you call the
update. That will eliminate or confirm the timing issue.

if(dr.warning Table IsNotNull And dr.warningTable[0].rows.count 0) then
gvDRWarnings.Da taSource = dr.warningTable
gvDRWarnings.Da taBind()
up.Update()
end if

--
_____________ ___________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professiona l VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"Bruno Alexandre" <br*********@gm ail.comwrote in message
news:%2****** ************@TK 2MSFTNGP05.phx. gbl...
Hi guys,

I have this page that needs to be populated with 2 diferent web
services, and each one takes more or less 10 seconds to finish populate
his own part, so I move on to the multi threading inside ASP.NET.

my questions is:

having a ASP.NET AJAX page and my gridView inside an atlas:UpdatePan el
control how can I update the panel so it shows the datagrid with the
results from the webservice?

Sub callDRService()
Dim dr As New drService
dr.getDRInfoFro mWebService("Jo hn", "Hansen", "Nørregade 86", "5700",
False)
gvDRWarnings.Da taSource = dr.warningTable
gvDRWarnings.Da taBind()
up.Update()
End Sub

the up control is a UpdatePanel, but at the end of the thread the panel
simple wont update :-(

any thoughts?
code for page_load and thread call
-------------------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.Event Args) Handles Me.Load
populateDRFromW Service_Thread( )
End Sub
Public Sub populateDRFromW Service_Thread( )
Dim NewThread As Thread = New Thread(AddressO f callDRService)
NewThread.Prior ity = ThreadPriority. Lowest
NewThread.Start ()
End Sub
-------------------------
--

Bruno Alexandre
København, Danmark

"a portuguese in Denmark"




Oct 16 '06 #5

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

Similar topics

37
4867
by: ajikoe | last post by:
Hello, Is anyone has experiance in running python code to run multi thread parallel in multi processor. Is it possible ? Can python manage which cpu shoud do every thread? Sincerely Yours, Pujo
77
5256
by: Jon Skeet [C# MVP] | last post by:
Please excuse the cross-post - I'm pretty sure I've had interest in the article on all the groups this is posted to. I've finally managed to finish my article on multi-threading - at least for the moment. I'd be *very* grateful if people with any interest in multi-threading would read it (even just bits of it - it's somewhat long to go through the whole thing!) to check for accuracy, effectiveness of examples, etc. Feel free to mail...
13
348
by: notregister | last post by:
my program have as many as 8 threads running at a same time. can different threads open a same file at the same time? let say thread1 open a file abc.txt at the same time with thread 2, both doing at different operation...
2
4880
by: NiponW | last post by:
Hi, I have SQL SERVER 2000 SP4 Enterprise , Windows 2003 Enterprise on Xeon 4 Processors (now with multi-threading CPU) and I have questions which seem weirds to me (used to have the same config without Multi-Threading) as following: 1. SQL Server see 8 CPUs. Is this because of multi-threading CPUs ? 2. when use SP_WHO2 ACTIVE ,
2
1347
by: johkar | last post by:
I have several related multi-selects on a page (country, state/ province, city, address). There are 4 - 7 other unrelated fields on the page also. Even though this is an intranet app where a traditional submit is normally very fast, there are other user/design considerations which make submitting the entire page not as desirable. I am just looking for some verification that an iframe returning an array would be fine. I have not...
0
1862
ammoos
by: ammoos | last post by:
hi friends pls help me.. i got an assignment which i feel very difficult to me.. i dont have more knowledge about multi-threading in .net... the assignment details is below.... pls help me... i have to submit this assignment today evening... please....... Windows Application to demonstrate the use of Multi-Threading with Synchronous & Asynchronous Threading. Requirements 1) A form with a) a button to initialize threads ...
0
4935
by: bharathreddy | last post by:
Vs 2008 is the MS latest IDE for developing Windows, Web, Smart Device Applications. It comes along with .NET Framework 3.5, C# 3.0, LINQ, ASP.NET AJAX and VSTO . Now with the power of VS 2008 we can target multiple versions of .NET Framework. Installation steps here VS 2008 Multi-Targeting Support: Previously every VisualStudio release supports its own specific version of .NET Framework. That is VS 2002 with .NET 1.0 ...
5
3518
by: George Maicovschi | last post by:
As multi-threading is not built in PHP I've been using a hack letting the Apache server handle the multi-threading issues, but I'm really curious of other approaches to this issue. If anyone has any ideas I'd be more than glad to hear them up and discuss them.
1
1706
by: =?Utf-8?B?QU1lcmNlcg==?= | last post by:
Sorry this is so long winded, but here goes. Following the model of http://msdn2.microsoft.com/en-us/library/system.runtime.remoting.channels.ipc.ipcchannel.aspx I made a remote object using the IpcChannel Class (vs 2005, vb, fw 2.0). Everyting works fine. The object is registered with WellKnownObjectMode.Singleton The remote object appears at the bottom of this posting. The code is deliberately obtuse to expose an issue about when...
0
8221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8162
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8662
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7134
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6104
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5560
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4067
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.