Updating label text

K

kaczmar2

I have an ASP.NET page written in VB.NET that has a label:

<asp:Label runat="server" ID="lblStatus"
CssClass="LabelTxt"></asp:Label>

In my code behind, I am running some stored procedures and a DTS
package. Since the queries and the DTS package take a few seconds to
run, I want to update the status label after each step has completed:

lblStatus.Text = "Processing..."
' Process stored proc
lblStatus.Text &= "Done!<br>"
' Process DTS package
lblStatus.Text &= "Processing DTS Package...<br>"
' etc.

I know that I can do this if I do not use code behind by just using
Response.Write and Response.Flush() statements, as I would in classic
ASP.

However, is there a way on the server side to raise an event and update
the label accordingly? Any pointers would be appreciated.

Christian
 
B

bruce barker

its done the same way in .net. turn off buffering, and do response write,
response flush.

-- bruce (sqlwork.com)


| I have an ASP.NET page written in VB.NET that has a label:
|
| <asp:Label runat="server" ID="lblStatus"
| CssClass="LabelTxt"></asp:Label>
|
| In my code behind, I am running some stored procedures and a DTS
| package. Since the queries and the DTS package take a few seconds to
| run, I want to update the status label after each step has completed:
|
| lblStatus.Text = "Processing..."
| ' Process stored proc
| lblStatus.Text &= "Done!<br>"
| ' Process DTS package
| lblStatus.Text &= "Processing DTS Package...<br>"
| ' etc.
|
| I know that I can do this if I do not use code behind by just using
| Response.Write and Response.Flush() statements, as I would in classic
| ASP.
|
| However, is there a way on the server side to raise an event and update
| the label accordingly? Any pointers would be appreciated.
|
| Christian
|
 
K

kaczmar2

Right, but the point is I would rather utilize the TExt property of the
label, so that way, I will have more control over the output on the
page. Hence my question, is there a way to raise an event on the
server side and then update the label text periodically? I would
rather NOT use response.write and response.flush.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top