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

Redirect after upload 1 file

1 Answer 62 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Viorel Teodorescu
Top achievements
Rank 1
Viorel Teodorescu asked on 28 Jul 2010, 07:11 PM
Hi everyone, I need some help,

I'm using silverLight upload on an asp.net mvc application, the only need is to upload one file and redirect to another page(view).
so I do under saveChunkData method:
SaveChunkData(...............
if (this.IsFinalFileRequest()) {
this.Context.Response.Redirect("myurl");
}

getting this exception:
[System.Threading.ThreadAbortException] = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}

Is there a way to modify the redirect to work?, or there is a better solution for redirecting?,

thanks in advance

1 Answer, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 02 Aug 2010, 12:27 PM
Hi Viorel,

Thank you for contacting us. I've managed to reproduce the issue and I've logged it in our public issue tracking system under the name "Upload: Unable to redirect after file upload". The item will be available for tracking tomorrow the latest. We will further investigate the issue and see what is causing it. Meanwhile you can redirect from the Silverlight application by hooking to the FileUploaded event of RadUpload.

<telerik:RadUpload x:Name="radUpload"
        Filter="All Files(*.*)|*.*|Archive files|*.zip;*.rar|Image Files (*.gif;*.jpg;*.jpeg;*.png)|*.gif;*.jpg;*.jpeg;*.png"
        FilterIndex="3" IsAutomaticUpload="True" OverwriteExistingFiles="True"
        UploadServiceUrl="../MyRadUploadHandler.ashx" TargetFolder="MyStorageFolder"
        HorizontalAlignment="Left" VerticalAlignment="Stretch" MaxHeight="9999"
        FileUploaded="radUpload_FileUploaded" />

private void radUpload_FileUploaded(object sender, FileUploadedEventArgs e)
{
    RadUploadSelectedFile uploadedFile = e.SelectedFile;
    if (e.HandlerData.IsSuccess)
    {
        HtmlPage.Window.Navigate(new Uri("http://www.google.com"));
    }
}

Let me know if this will work for you. I've also updated your Telerik points accordingly.

Best wishes,
Kiril Stanoev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Upload
Asked by
Viorel Teodorescu
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Share this question
or