Progold S.p.A.
asked on
Redirect from IhttpHandler ashx.vb file
I have a problem with a ashx.vb file
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessReques t
Try
/* CODE TO UPLOAD THE FILE */
context.Response.Redirect( "~/Prodott i/STEP6.as px", False)
Return
Catch ex As Exception
Throw New Exception("Error", ex)
End Try
Catch ex As Exception
Dim msg As String = GestioneErrori.TrapError(e x)
context.Response.Write(msg )
End Try
End Sub
I use it to process the request of uploading a file using uploadify.
I need to reload the page which contains the fileUpload object.
I think context.Response.Redirect( "~/Prodott i/STEP6.as px", False) was the only way but it doen't work.
The file upload shows http error 302 (see 302.png)
the ashx.vb file is store in a folder at the same level of the folder which contains the page to be redirected (see tree.png)
Any idea?
thank you
302.png
tree.png
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessReques
Try
/* CODE TO UPLOAD THE FILE */
context.Response.Redirect(
Return
Catch ex As Exception
Throw New Exception("Error", ex)
End Try
Catch ex As Exception
Dim msg As String = GestioneErrori.TrapError(e
context.Response.Write(msg
End Try
End Sub
I use it to process the request of uploading a file using uploadify.
I need to reload the page which contains the fileUpload object.
I think context.Response.Redirect(
The file upload shows http error 302 (see 302.png)
the ashx.vb file is store in a folder at the same level of the folder which contains the page to be redirected (see tree.png)
Any idea?
thank you
302.png
tree.png
i think you need to use context.completeRequest instead
ASKER
It's not working :(
I had to write
context.Response.Redirect( "~/Prodott i/STEP6.as px", False)
context.ApplicationInstanc e.Complete Request()
because completerequest was not available directly on context
('CompleteRequest' is not a member of 'System.Web.HttpContext')
I had to write
context.Response.Redirect(
context.ApplicationInstanc
because completerequest was not available directly on context
('CompleteRequest' is not a member of 'System.Web.HttpContext')
ASKER
Ps. I also tried with
HttpContext.Current.Respon se.Redirec t("~/Prodo tti/STEP6. aspx", False)
HttpContext.Current.Applic ationInsta nce.Comple teRequest( )
and
HttpContext.Current.Applic ationInsta nce.Respon se.Redirec t("~/Prodo tti/STEP6. aspx", False)
HttpContext.Current.Applic ationInsta nce.Comple teRequest( )
but both didn't work
HttpContext.Current.Respon
HttpContext.Current.Applic
and
HttpContext.Current.Applic
HttpContext.Current.Applic
but both didn't work
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I solved the problem after the comment of the expert