if (FileUpload1.HasFile)
{
string extension = System.IO.Path.GetExtension(FileUpload1.FileName);
if (extension == ".jpg" || extension == ".jpeg" || extension == ".JPG" || extension == ".JPEG")
{
SaveFile(FileUpload1.PostedFile);
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmessage", "javascript:alert('Only .Jpg File allowed')", true);
}
{
string extension = System.IO.Path.GetExtension(FileUpload1.FileName);
if (extension == ".jpg" || extension == ".jpeg" || extension == ".JPG" || extension == ".JPEG")
{
SaveFile(FileUpload1.PostedFile);
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmessage", "javascript:alert('Only .Jpg File allowed')", true);
}
No comments:
Post a Comment