K
Kilic Beg
Hi,
I want to prevent user to upload files larger than 2MB.
If they try to upload I want to redirect them to a error page (ex: File size
larger than 2 MB )..
right now I get a page break "The page cannot be displayed"
I tried to update the Global.asax.cs file this is the code
protected void Application_BeginRequest(Object sender, EventArgs e)
{
long MAX_CONTENTLENGTH = 2097152;
if (Request.ContentLength > MAX_CONTENTLENGTH) {
//Response.Write("File is to big");
Response.Redirecty("Error.html");
}
}
I put the same code also into
protected void Application_Error(Object sender, EventArgs e)
method..
still page break..
where and how can I catch that and redirect to a friendly error page.
do I have to use a third party product for that ?
Please help !!!
Thanks
- Kilic
I want to prevent user to upload files larger than 2MB.
If they try to upload I want to redirect them to a error page (ex: File size
larger than 2 MB )..
right now I get a page break "The page cannot be displayed"
I tried to update the Global.asax.cs file this is the code
protected void Application_BeginRequest(Object sender, EventArgs e)
{
long MAX_CONTENTLENGTH = 2097152;
if (Request.ContentLength > MAX_CONTENTLENGTH) {
//Response.Write("File is to big");
Response.Redirecty("Error.html");
}
}
I put the same code also into
protected void Application_Error(Object sender, EventArgs e)
method..
still page break..
where and how can I catch that and redirect to a friendly error page.
do I have to use a third party product for that ?
Please help !!!
Thanks
- Kilic