J
Jay
I have been trying to use maxRequestLength to stop users from uploading
large files. It put this code in the web.config file:
<httpRuntime
maxRequestLength="128" />
--The upload works fine.
--When I select a large file I get the "Page cannot be displayed" message,
which is correct.
The problem is that I am trying redirect the user to a meaningful error
page or back to the upload page showing an error message. To do this I put
the code below in Page_Error or Application_Error. I have epxerimented with
both.
Server.ClearError()
Session("UPLOADERROR") = "yes"
Response.Redirect("ErrorPage.aspx")
No matter what I do I get the "Page cannot be displayed" messaage, rather
than being redirected. When this error message is displayed the URL in the
browser is showing update.aspx, not the error page.apsx. If I refresh I
get the Upload.aspx page. When I try to upload a large file and I set a
break point on Page_Error I can step to Reponse.redirect("ErrorPage.aspx")
but it does not redirect to ErrorPage.aspx.
I have also experimented with the web.config setting customErrors but I get
the same thing.
Help!!
Jay
large files. It put this code in the web.config file:
<httpRuntime
maxRequestLength="128" />
--The upload works fine.
--When I select a large file I get the "Page cannot be displayed" message,
which is correct.
The problem is that I am trying redirect the user to a meaningful error
page or back to the upload page showing an error message. To do this I put
the code below in Page_Error or Application_Error. I have epxerimented with
both.
Server.ClearError()
Session("UPLOADERROR") = "yes"
Response.Redirect("ErrorPage.aspx")
No matter what I do I get the "Page cannot be displayed" messaage, rather
than being redirected. When this error message is displayed the URL in the
browser is showing update.aspx, not the error page.apsx. If I refresh I
get the Upload.aspx page. When I try to upload a large file and I set a
break point on Page_Error I can step to Reponse.redirect("ErrorPage.aspx")
but it does not redirect to ErrorPage.aspx.
I have also experimented with the web.config setting customErrors but I get
the same thing.
Help!!
Jay