Posted on: 9/23/2012 3:03:13 AM | Views : 210

if ((fileExt2.ToUpper() == ".JPG")||(fileExt.ToUpper() == ".JPEG")||(fileExt.ToUpper() == ".PNG")||(fileExt.ToUpper() == ".GIF")) { if (Fupimage.PostedFile.ContentLength > 1000000) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "Alert", "alert('File is too big.')", true); } else { Do something; } } else { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "Alert", "alert('File is not appropriate.')", true); }

why this if statement  doesn't work. it only accepts .jpg files and it doesn't check other conditions, if the file was png or gif or jpeg it ...

Go to the complete details ...