This is a migrated thread and some comments may be shown as answers.

Cancell Button and refresh page

2 Answers 357 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Mauro
Top achievements
Rank 1
Mauro asked on 07 Aug 2008, 11:19 AM
There are some method or property that reload the page when the user click on cancel button ?

cheers
M.

2 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 11 Aug 2008, 09:07 AM
Hello Mauro,

You can try subscribing to the OnClientProgressUpdating event of the RadProgressManager and cancel the request (then refresh the page) as shown in the example below:

<telerik:RadProgressManager ID="RadProgressManager1" runat="server" OnClientProgressUpdating="OnClientProgressUpdatingHandler" /> 
 
<telerik:RadProgressArea ID="RadProgressArea1" runat="server" DisplayCancelButton="true"
</telerik:RadProgressArea> 
 
<telerik:RadUpload ID="RadUpload1" runat="server"
</telerik:RadUpload> 
 
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> 

<script type="text/javascript"
function OnClientProgressUpdatingHandler(sender, eventArgs) 
    var progressArea = $find("<%= RadProgressArea1.ClientID %>"); 
    if (progressArea.cancelClicked
    { 
        progressArea.cancelRequest(); 
        window.location.reload(); 
    } 
</script>  

I hope this helps.

All the best,
Veskoni
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jason
Top achievements
Rank 1
answered on 11 Mar 2009, 07:56 PM
I'm trying to do some custom manipulation of the HTML on cancel (I'm hiding the submit form on submit, and I need to un-hide it on cancel). So I tried the code above, but the handler is never being fired after I click Cancel.

Here's my code:

function OnClientProgressUpdatingHandler(sender, eventArgs) { 
             var progressArea = $find("<asp:Literal ID="litRadUploadClientId" runat="server" />"); 
              
             if (progressArea.cancelClicked) { 
                window.alert("cancel has been clicked"); 
                 progressArea.cancelRequest(); 
                 document.getElementById("tblUploadForm").style.display = ""
             } 
         } 

Just a note, the reason for the asp:Literal is that my upload form is in a RadWindow, and putting <% %> tags in there causes errors. Here's what it looks like when it goes to the browser:

function OnClientProgressUpdatingHandler(sender, eventArgs) { 
             var progressArea = $find("RadProgressArea1"); 
              
             if (progressArea.cancelClicked) { 
                window.alert("cancel has been clicked"); 
                 progressArea.cancelRequest(); 
                 document.getElementById("tblUploadForm").style.display = ""
             } 
         } 

Why isn't the handler being called after cancel?





Tags
Upload (Obsolete)
Asked by
Mauro
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Jason
Top achievements
Rank 1
Share this question
or