My case is when I am uploading file with size more than 4mb i want to display a friendly message to the user but when i accross this limit it dose not give me an error instead it takes me to :
Internet Explorer cannot display the webpage
what i am doing to check on file size is like that :
if (FU_EnglishFile.PostedFile.ContentLength > int.Parse(ConfigurationManager.AppSettings["MaxUploadSize"]))
{
lbl_InvalidFileMsg.Visible = true;
return;
}
else
{
lbl_InvalidFileMsg.Visible = false;
}
where my file size from the web config is :
<add key="MaxUploadSize" value="4194304" />
is there is any configuration should i set in the web config or something any help would be a appreciated