Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I output the current progress information in a label?
I tried to use the code below, but don't get a refresh of the panel - except on the end of the script. If I replace the button with a timer and use the timer.tick-event instead of button.click it works.

[VB.net sample code]
VB
Protected Sub buttin1_Click(sender As Object, e As EventArgs) Handles button1.Click
    dim iCount as integer = 0
    For each row as datarow in tbl.rows
        '...do somethig...
        system.threading.thread.sleep(1500)
        i+=1
        info1.text = "Done " & i & " / " & tbl.rows.count & " rows.< br />"
    next
    
    info1.text &= "Complete."
end sub


[ASP.net sample code]
ASP.NET
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel runat="server" ID="updatePanel1" UpdateMode="Always">
	<ContentTemplate>
                <asp:Button runat="server" ID="button1" Text="do something" />
        	<asp:Literal runat="server" ID="info1" />
	</ContentTemplate>
</asp:UpdatePanel>e
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900