I have in my C#/asp.net
System.Web.UI.HtmlControls
.HtmlInput
File MyFile;
if ((MyFile.PostedFile.Conten
tLength == 0) && (MyFile.PostedFile.FileNam
e != ""))
{
strFileName = MyFile.PostedFile.FileName
;
FileUploadMsgLB.Text = "An Error occured. Please check the attached file: " + strFileName;
return;
}
It works fine,but if the user types junk into the text area (say "asdfg") my catch or If statements don't seem to be triggered and the web just sits there when the submit button is hit.
Funny thing is if the user types junk into the text area(say "c:asdfg" or "c:\asdfg" or "a:asdfg" ...) my catch statement is hit and error label is updated.
Start Free Trial