473,471 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Monitoring a Web Page request Thread?

hi All,

I dont know if this is possible, so i am asking

Is there a Way to monitor a connection when it is fetching on a web page? I
am providing a status Bar and process to my users so they can see something
is happening?

I would like to do a while loop as in

i+=1
Do while ConnectionState.Fetching
WriteStatusUpdate(writer, "Fetching Records ..." & i.toString(), true)
i+=1
loop
I am currently using the Protected OverRide Render writer to show status,
and would like a little more detail?

Any Suggestions Grealt Appreciated, If you need to review the code, while
lenghty, may help some one else. Code as Follows:

thanks in advance
Smantha

Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)

Dim strmsg As String = ""

' Call the parent render and then flush the contents to get them to the
browser quickly

MyBase.Render(writer)

writer.Flush()

Response.Flush()

' Check to see if btnClear was clicked and that's why we're rendering

If boolStartEvent Then

' Send a "starting operation" message

WriteStatusUpdate(writer, "Checking Connection ...", False)

' Do your long running operation here - provide status at will

Dim TimerEnd As Long = Now().Ticks + 100000000

While Now().Ticks <= TimerEnd

End While

If IsPostBack Then

strmsg = checkConnection()

End If

If blnConnectFound = True Then

WriteStatusUpdate(writer, "Found. Proceeding With Update,Please Wait.",
True)

writer.Flush()

Response.Flush()

chkConn = New SqlConnection

chkConn.ConnectionString = ConfigurationSettings.AppSettings("SqlServer")

Try

chkConn.Open()

cmdSql.Connection = chkConn

cmdSql.CommandType = CommandType.StoredProcedure

cmdSql.CommandText = "csp_INSERT_Get_Member_Info"

cmdSql.ExecuteNonQuery()

*************************************************

Would like to Monitor thread here if Possible?

*************************************************

chkConn.Close()

chkConn.Dispose()

chkConn = Nothing

cmdSql = Nothing

WriteStatusUpdate(writer, "Update Completed. Please Click Find a Patient.",
True)

writer.Flush()

Response.Flush()

Exit Sub

Catch ex As Exception

WriteStatusUpdate(writer, "Connection to DB not Available because." & "<BR>"
& ex.Message, True)

writer.Flush()

Response.Flush()

chkConn.Close()

chkConn.Dispose()

chkConn = Nothing

cmdSql = Nothing

End Try

End If

statBar.Style.Clear()

statBar.Style.Add("display", "none")

Response.Flush()

' Clear flag

boolStartEvent = False

Response.Flush()

End If

End Sub

Private Sub WriteStatusUpdate(ByVal writer As System.Web.UI.HtmlTextWriter,
ByVal Status As String, ByVal NewLine As Boolean)

If NewLine Then

writer.Write _

(String.Format("<script
language=""javascript"">document.all[""updatingGif""].innerHTML +=
""{0}<br>"";</script>", Status))

Else

writer.Write _

(String.Format("<script
language=""javascript"">document.all[""updatingGif""].innerHTML +=
""{0}"";</script>", Status))

End If

writer.Flush()

Response.Flush()

End Sub


Nov 18 '05 #1
3 1005
This will not work because the flushing to the browser only occurs after the
main thread is processing. You will not see any incremental updates.

To create a status bar, you need to do so on a separate thread. While one
thread does work, the other thread updates the user interface. About the
easiest thing you can do to get this to work if you don't want to thread is
to cause the page to refresh itself with a meta refresh tag every so often.
At this refresh time, you will update your status bar appropriately.

Regards

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Elizabeth Harmon" <EH*****@bloomingtonfarms.com> wrote in message
news:OU**************@TK2MSFTNGP10.phx.gbl...
hi All,

I dont know if this is possible, so i am asking

Is there a Way to monitor a connection when it is fetching on a web page? I am providing a status Bar and process to my users so they can see something is happening?

I would like to do a while loop as in

i+=1
Do while ConnectionState.Fetching
WriteStatusUpdate(writer, "Fetching Records ..." & i.toString(), true)
i+=1
loop
I am currently using the Protected OverRide Render writer to show status,
and would like a little more detail?

Any Suggestions Grealt Appreciated, If you need to review the code, while
lenghty, may help some one else. Code as Follows:

thanks in advance
Smantha

Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
Dim strmsg As String = ""

' Call the parent render and then flush the contents to get them to the
browser quickly

MyBase.Render(writer)

writer.Flush()

Response.Flush()

' Check to see if btnClear was clicked and that's why we're rendering

If boolStartEvent Then

' Send a "starting operation" message

WriteStatusUpdate(writer, "Checking Connection ...", False)

' Do your long running operation here - provide status at will

Dim TimerEnd As Long = Now().Ticks + 100000000

While Now().Ticks <= TimerEnd

End While

If IsPostBack Then

strmsg = checkConnection()

End If

If blnConnectFound = True Then

WriteStatusUpdate(writer, "Found. Proceeding With Update,Please Wait.",
True)

writer.Flush()

Response.Flush()

chkConn = New SqlConnection

chkConn.ConnectionString = ConfigurationSettings.AppSettings("SqlServer")

Try

chkConn.Open()

cmdSql.Connection = chkConn

cmdSql.CommandType = CommandType.StoredProcedure

cmdSql.CommandText = "csp_INSERT_Get_Member_Info"

cmdSql.ExecuteNonQuery()

*************************************************

Would like to Monitor thread here if Possible?

*************************************************

chkConn.Close()

chkConn.Dispose()

chkConn = Nothing

cmdSql = Nothing

WriteStatusUpdate(writer, "Update Completed. Please Click Find a Patient.", True)

writer.Flush()

Response.Flush()

Exit Sub

Catch ex As Exception

WriteStatusUpdate(writer, "Connection to DB not Available because." & "<BR>" & ex.Message, True)

writer.Flush()

Response.Flush()

chkConn.Close()

chkConn.Dispose()

chkConn = Nothing

cmdSql = Nothing

End Try

End If

statBar.Style.Clear()

statBar.Style.Add("display", "none")

Response.Flush()

' Clear flag

boolStartEvent = False

Response.Flush()

End If

End Sub

Private Sub WriteStatusUpdate(ByVal writer As System.Web.UI.HtmlTextWriter, ByVal Status As String, ByVal NewLine As Boolean)

If NewLine Then

writer.Write _

(String.Format("<script
language=""javascript"">document.all[""updatingGif""].innerHTML +=
""{0}<br>"";</script>", Status))

Else

writer.Write _

(String.Format("<script
language=""javascript"">document.all[""updatingGif""].innerHTML +=
""{0}"";</script>", Status))

End If

writer.Flush()

Response.Flush()

End Sub


Nov 18 '05 #2
Is there an Example of this some where?

thanks in advance
Samantha
"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:eN**************@TK2MSFTNGP09.phx.gbl...
This will not work because the flushing to the browser only occurs after the main thread is processing. You will not see any incremental updates.

To create a status bar, you need to do so on a separate thread. While one
thread does work, the other thread updates the user interface. About the
easiest thing you can do to get this to work if you don't want to thread is to cause the page to refresh itself with a meta refresh tag every so often. At this refresh time, you will update your status bar appropriately.

Regards

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Elizabeth Harmon" <EH*****@bloomingtonfarms.com> wrote in message
news:OU**************@TK2MSFTNGP10.phx.gbl...
hi All,

I dont know if this is possible, so i am asking

Is there a Way to monitor a connection when it is fetching on a web page?
I
am providing a status Bar and process to my users so they can see

something
is happening?

I would like to do a while loop as in

i+=1
Do while ConnectionState.Fetching
WriteStatusUpdate(writer, "Fetching Records ..." & i.toString(),

true) i+=1
loop
I am currently using the Protected OverRide Render writer to show status, and would like a little more detail?

Any Suggestions Grealt Appreciated, If you need to review the code, while lenghty, may help some one else. Code as Follows:

thanks in advance
Smantha

Protected Overrides Sub Render(ByVal writer As

System.Web.UI.HtmlTextWriter)

Dim strmsg As String = ""

' Call the parent render and then flush the contents to get them to the
browser quickly

MyBase.Render(writer)

writer.Flush()

Response.Flush()

' Check to see if btnClear was clicked and that's why we're rendering

If boolStartEvent Then

' Send a "starting operation" message

WriteStatusUpdate(writer, "Checking Connection ...", False)

' Do your long running operation here - provide status at will

Dim TimerEnd As Long = Now().Ticks + 100000000

While Now().Ticks <= TimerEnd

End While

If IsPostBack Then

strmsg = checkConnection()

End If

If blnConnectFound = True Then

WriteStatusUpdate(writer, "Found. Proceeding With Update,Please Wait.",
True)

writer.Flush()

Response.Flush()

chkConn = New SqlConnection

chkConn.ConnectionString = ConfigurationSettings.AppSettings("SqlServer")
Try

chkConn.Open()

cmdSql.Connection = chkConn

cmdSql.CommandType = CommandType.StoredProcedure

cmdSql.CommandText = "csp_INSERT_Get_Member_Info"

cmdSql.ExecuteNonQuery()

*************************************************

Would like to Monitor thread here if Possible?

*************************************************

chkConn.Close()

chkConn.Dispose()

chkConn = Nothing

cmdSql = Nothing

WriteStatusUpdate(writer, "Update Completed. Please Click Find a

Patient.",
True)

writer.Flush()

Response.Flush()

Exit Sub

Catch ex As Exception

WriteStatusUpdate(writer, "Connection to DB not Available because." &

"<BR>"
& ex.Message, True)

writer.Flush()

Response.Flush()

chkConn.Close()

chkConn.Dispose()

chkConn = Nothing

cmdSql = Nothing

End Try

End If

statBar.Style.Clear()

statBar.Style.Add("display", "none")

Response.Flush()

' Clear flag

boolStartEvent = False

Response.Flush()

End If

End Sub

Private Sub WriteStatusUpdate(ByVal writer As

System.Web.UI.HtmlTextWriter,
ByVal Status As String, ByVal NewLine As Boolean)

If NewLine Then

writer.Write _

(String.Format("<script
language=""javascript"">document.all[""updatingGif""].innerHTML +=
""{0}<br>"";</script>", Status))

Else

writer.Write _

(String.Format("<script
language=""javascript"">document.all[""updatingGif""].innerHTML +=
""{0}"";</script>", Status))

End If

writer.Flush()

Response.Flush()

End Sub



Nov 18 '05 #3
Did you figure this out or get help on this?

--
Regards,
Alvin Bruney
Got Tidbits? Get it here
www.networkip.net/tidbits
"Elizabeth Harmon" <EH*****@bloomingtonfarms.com> wrote in message
news:OV**************@TK2MSFTNGP10.phx.gbl...
Is there an Example of this some where?

thanks in advance
Samantha
"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:eN**************@TK2MSFTNGP09.phx.gbl...
This will not work because the flushing to the browser only occurs after

the
main thread is processing. You will not see any incremental updates.

To create a status bar, you need to do so on a separate thread. While one
thread does work, the other thread updates the user interface. About the
easiest thing you can do to get this to work if you don't want to thread

is
to cause the page to refresh itself with a meta refresh tag every so

often.
At this refresh time, you will update your status bar appropriately.

Regards

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Elizabeth Harmon" <EH*****@bloomingtonfarms.com> wrote in message
news:OU**************@TK2MSFTNGP10.phx.gbl...
hi All,

I dont know if this is possible, so i am asking

Is there a Way to monitor a connection when it is fetching on a web

page?
I
am providing a status Bar and process to my users so they can see

something
is happening?

I would like to do a while loop as in

i+=1
Do while ConnectionState.Fetching
WriteStatusUpdate(writer, "Fetching Records ..." & i.toString(),

true) i+=1
loop
I am currently using the Protected OverRide Render writer to show status, and would like a little more detail?

Any Suggestions Grealt Appreciated, If you need to review the code, while lenghty, may help some one else. Code as Follows:

thanks in advance
Smantha

Protected Overrides Sub Render(ByVal writer As

System.Web.UI.HtmlTextWriter)

Dim strmsg As String = ""

' Call the parent render and then flush the contents to get them to the browser quickly

MyBase.Render(writer)

writer.Flush()

Response.Flush()

' Check to see if btnClear was clicked and that's why we're rendering

If boolStartEvent Then

' Send a "starting operation" message

WriteStatusUpdate(writer, "Checking Connection ...", False)

' Do your long running operation here - provide status at will

Dim TimerEnd As Long = Now().Ticks + 100000000

While Now().Ticks <= TimerEnd

End While

If IsPostBack Then

strmsg = checkConnection()

End If

If blnConnectFound = True Then

WriteStatusUpdate(writer, "Found. Proceeding With Update,Please Wait.", True)

writer.Flush()

Response.Flush()

chkConn = New SqlConnection

chkConn.ConnectionString = ConfigurationSettings.AppSettings("SqlServer")
Try

chkConn.Open()

cmdSql.Connection = chkConn

cmdSql.CommandType = CommandType.StoredProcedure

cmdSql.CommandText = "csp_INSERT_Get_Member_Info"

cmdSql.ExecuteNonQuery()

*************************************************

Would like to Monitor thread here if Possible?

*************************************************

chkConn.Close()

chkConn.Dispose()

chkConn = Nothing

cmdSql = Nothing

WriteStatusUpdate(writer, "Update Completed. Please Click Find a

Patient.",
True)

writer.Flush()

Response.Flush()

Exit Sub

Catch ex As Exception

WriteStatusUpdate(writer, "Connection to DB not Available because." &

"<BR>"
& ex.Message, True)

writer.Flush()

Response.Flush()

chkConn.Close()

chkConn.Dispose()

chkConn = Nothing

cmdSql = Nothing

End Try

End If

statBar.Style.Clear()

statBar.Style.Add("display", "none")

Response.Flush()

' Clear flag

boolStartEvent = False

Response.Flush()

End If

End Sub

Private Sub WriteStatusUpdate(ByVal writer As

System.Web.UI.HtmlTextWriter,
ByVal Status As String, ByVal NewLine As Boolean)

If NewLine Then

writer.Write _

(String.Format("<script
language=""javascript"">document.all[""updatingGif""].innerHTML +=
""{0}<br>"";</script>", Status))

Else

writer.Write _

(String.Format("<script
language=""javascript"">document.all[""updatingGif""].innerHTML +=
""{0}"";</script>", Status))

End If

writer.Flush()

Response.Flush()

End Sub




Nov 18 '05 #4

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

Similar topics

1
by: Ron | last post by:
I am trying to run asp.net pages. The server is accessed via http://sitename/username I have verified it is using port 80 and aspx extensions are configured. But when I run and asp.net page I...
1
by: Edward Yang | last post by:
I setup web.config with impersonation="true". On our local server the project works great. I did the same procedures on our staging server, but it failed with an impossible error: Server Error in...
0
by: Ron Simpson | last post by:
I am trying to run asp.net pages. The server is accessed via http://sitename/username I have verified it is using port 80 and aspx extensions are configured. But when I run and asp.net page I...
9
by: Tim D | last post by:
Hi, I originally posted this as a reply to a rather old thread in dotnet.framework.general and didn't get any response. I thought it might be more relevant here; anyone got any ideas? My...
5
by: Jay Ge | last post by:
I searched this issue in internet, but they still cannot solve my issue, so your help/suggestion will be preciated. this page is placed on serverA, and it will touch files on serverB.(but it...
5
by: Joe | last post by:
I'm getting the following error when trying to call a page on a secure server. I'm not doing any impersonations or file access of any kind. The page is using PayPal and I'm wondering if PayPal has...
5
by: Ben | last post by:
I am building a web app using ASP.NET 2.0. One of the requirements is that we link to a third party vendor's site, display their content. let the user make choices on the vendors site and then...
7
by: =?Utf-8?B?Q2FybG8gRm9saW5p?= | last post by:
Hi, I implemented asynchronous calls to a web resource (using HttpWebRequest) from asp.net 2.0. The request it's made asyncronously (I see that beginGetResponse returns immediately). The number...
1
by: brad.serbus | last post by:
I am trying to figure out a way to have health monitoring throw different Event IDs into the event log, and am having a hard time. None of the customization that I have looked through so far has...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
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...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.