G
Gary Wardell
Hi,
If HasFile is true, why is PostedFile "sometimes" == null in my tests?
That is, if I resubmit the form with the same data it's not null, and may be
repeatedly not null. But then it will occasionally be null again, for one
or two submits. It seems to be random.
What's going on here?
This is using ASP.net 2.0 SP 1.
Gary
private FileUpload FileUp;
FileUp = (FileUpload)Pnl.FindControl("FileUp");
if (!FileUp.HasFile)
{
if (FileUp.PostedFile == null) throw new
NullReferenceException("PostedFile is Null");
if (FileUp.PostedFile.ContentLength == 0)
{
MJOStaff.SetMsg("The file is either missing or empty",
MJOStaff.msgType.Warning);
return;
}
}
If HasFile is true, why is PostedFile "sometimes" == null in my tests?
That is, if I resubmit the form with the same data it's not null, and may be
repeatedly not null. But then it will occasionally be null again, for one
or two submits. It seems to be random.
What's going on here?
This is using ASP.net 2.0 SP 1.
Gary
private FileUpload FileUp;
FileUp = (FileUpload)Pnl.FindControl("FileUp");
if (!FileUp.HasFile)
{
if (FileUp.PostedFile == null) throw new
NullReferenceException("PostedFile is Null");
if (FileUp.PostedFile.ContentLength == 0)
{
MJOStaff.SetMsg("The file is either missing or empty",
MJOStaff.msgType.Warning);
return;
}
}