tenho dois botãoes dentro de um update panel. botão de executar e outro de cancelar operação.
quando clico em executar meu updateprogress é chamado e executa um processo.
html
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<div align="center" style="width: 100%;" id='loading'>
<asp:Panel ID="panelLoading" runat="server" Height="100%" Width="100%">
<img src="../Imagens/carregando.gif" / alt="">
<asp:Label ID="lblCarregando" runat="server" Font-Bold="False" Font-Size="Small"
Text="Gerando Balanço/DRE..." Font-Names="arial, helvetica, Serif"></asp:Label>
</asp:Panel>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel ID="pnl1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Executar" />
<asp:Button ID="Button1" runat="server" Text="Cancelar Operação" />
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
No page_load desabilito os botões quando está processando, ou seja, meu updateprogress1 está visível.
Dim csname As String = "OnSubmitScript" 'Define o nome e o tipo de script da página cliente
Dim cstype As Type = Me.GetType() 'obtém uma referência do ClientScriptManager da classe Page.
Dim cs As ClientScriptManager = Page.ClientScript 'verifica se o evento OnSubmit já está registrado.
HttpContext.Current.Session("Mensagem") = String.Empty
If Not cs.IsOnSubmitStatementRegistered(cstype, csname) Then
Dim cstext As String = "if (typeof(ValidatorOnSubmit) == 'function' && ValidatorOnSubmit() == false)return false; else { var myCtl = document.getElementById('" & Convert.ToString(Me.btFiltrar.ClientID)
& "'); var myCtl1 = document.getElementById('" & Convert.ToString(Me.btView.ClientID) & "'); myCtl.value = 'Gerando Simulação...'; myCtl1.value = 'Visualizar...'; myCtl.disabled = true; myCtl1.disabled = true;}"
cs.RegisterOnSubmitStatement(cstype, csname, cstext)
End If
o que precsiso é que quando for clicado no botão cancelar operação, a página pare de processar (saia do método que processa) e que o updateprogress não estaja mais processando (não fique mais visível).pare, como se tivesse aberto a página.