How to check whether File-Upload control contains any file or not?

 Posted by vishalneeraj-24503 on 12/23/2013 | Category: ASP.NET Interview questions | Views: 1189 | Points: 40
Answer:

With the help of HasFile property of File-Upload control,we can check whether File-Upload control contains any file or not.

It returns true if File-Upload control contains any file(s) otherwise returns false.

For Example:-

if(fld_upload.HasFile)

{
//it contains file
}
else
{
//it does not contain any file
}


Where,fld_upload is our Asp.Net File upload control.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response