<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Upload.aspx.vb" Inherits="TourEx.Web.Upload" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>文件上传</title>
</head>
<body style="margin: 0; padding: 0;">
    <script type="text/javascript">
       function CheckFile()
       {
       	var upext = 'jpg,jpeg,gif,png';
       	var ImgName = document.getElementById('FileUpload1').value;
       	if(ImgName==''){alert('请选择要上传的图片。');return false;}
       	if(!ImgName.match(new RegExp('\.('+upext.replace(/,/g,'|')+')$','i')))
       	{
       		alert('上传文件扩展名必需为：'+upext);return false;
       	}
       	document.getElementById('TourExForm').submit();
       }
    </script>
    <form id="TourExForm" runat="server">
    <asp:FileUpload ID="FileUpload1" runat="server" onchange="CheckFile();" accept="image/bmp, image/gif, image/pjpeg, image/jpeg, image/png"  />
    </form>
</body>
</html>