×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Using an UpdatePanel

Using an UpdatePanel

Using an UpdatePanel

(OP)
I am fairly new to asp.net for web development. I'm trying to do something that on the surface seems simple but when it is implemented it is anything but. I have a few textbox controls that need to be updated immediately from within a click event on a web page. All the examples I've found online are extremely simple and seem to work if I implement them. However, my real code doesn't work. Here is the code in its entirety. I've highlighted the UpdatePanel things as well as the controls that need to get updated in my click event:

<div>
<asp:UpdatePanel ID="DetailExport_UpdatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table>
<tr>
<td>
<table width="900">
<tr>
<td valign="Middle" colspan="3">
<asp:Label ID="Label19" runat="server" Font-Bold="True" Font-Size="Large" Text="Search Results" />
<asp:Button ID="btnExport" runat="server" CssClass="btnWrap" Text="Export Detail to Excel" />
<asp:Label ID="clblDetailData_Message" runat="server" Font-Bold="True" Text="Total Records 99,999 " />
<asp:Label ID="clblExportInfo" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="3"><hr size="3" color="Blue" /></td>
</tr>
<tr>
<td>
<asp:Panel ID="pnlPages" runat="server" Height="25px" Width="500px">
<asp:Label ID="lblPage_of_Pages" runat="server" Text="Page xx of yy" Font-Bold="True" />
<asp:Button ID="btnFirst" runat="server" Text="First" />
<asp:Button ID="btnPrev" runat="server" Text="&lt; Prev" />
<asp:Label ID="lblRows_of_Rows" runat="server" Text="Rows xxxx - yyyy" Font-Bold="True" />
<asp:Button ID="btnNext" runat="server" Text="Next &gt;" />
<asp:Button ID="btnLast" runat="server" Text="Last" />
</asp:Panel>
</td>
</tr>
</table>
</td>
<td>
<table width = "400">
<tr><td align="right"><asp:Label ID="Label9" runat="server" Text="Export Est. Time" Font-Bold="True" /></td><td><asp:TextBox ID="txtEstimatedTime" runat="server" BorderStyle="None" /></td></tr>
<tr><td align="right"><asp:Label ID="Label18" runat="server" Text="Export Started" Font-Bold="True" /></td><td><asp:TextBox ID="txtStarted" runat="server" BorderStyle="None" /></td></tr>
<tr><td align="right"><asp:Label ID="Label20" runat="server" Text="Export Stopped" Font-Bold="True" /></td><td><asp:TextBox ID="txtStopped" runat="server" BorderStyle="None" /></td></tr>
<tr><td align="right"><asp:Label ID="Label26" runat="server" Text="Elapsed Time" Font-Bold="True" /></td><td><asp:TextBox ID="txtElapsed" runat="server" BorderStyle="None" /></td></tr>
</table>
</td>
</tr>
</table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnExport" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</div>


Here is my click event that is attempting to update some of the text and label controls within the UpdatePanel:

Protected Sub btnExport_Click(sender As Object, e As EventArgs) Handles btnExport.Click
Dim strFilename As String = "AMS_SalesAnalysis.xlsx"
Dim strFullFileName As String = ""
Dim flgTesting As Boolean = True
Dim oExcelApp As Excel.Application = New Microsoft.Office.Interop.Excel.Application

txtEstimatedTime.Visible = True
txtStarted.Visible = True
txtStopped.Visible = True
txtElapsed.Visible = True

txtStarted.Text = ""
txtStopped.Text = ""
txtElapsed.Text = ""

clblExportInfo.Text = " Please Wait --- Creating Excel File "
clblExportInfo.Visible = True

txtStarted.Text = datetime.now.tostring( "HH:mm:ss" )
'
' Process ensues that takes several seconds
'
txtStopped.Text = datetime.now.tostring( "HH:mm:ss" )
End Sub

The clblExportInfo, txtStarted contents should be made visible immediately after being set, then after the process the txtStopped is updated. What is actually happening is that the contents of all the controls appear when the process is finished.

I hope this is a simple solution.

Thanks in advance,
Jerry

Jerry Scannell

RE: Using an UpdatePanel

Maybe you should try posting in the ASP forum

Cheers,
Dian

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close