<%@ Page Language="C#" AutoEventWireup="true" CodeFile="upload.aspx.cs" Inherits="upload" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <base target="_self"></base>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>未命名頁面</title>
      <script type="text/javascript">
     function setImagePreview( fileUrl ) 
        {             
            var objDivFilter = document.getElementById("divFilter")             
             
            if(fileUrl) 
            {    
                objDivFilter.style.width = "20px";     
                objDivFilter.style.height = "20px";        //这个设置初始大小是必须的          
                objDivFilter.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod = image)";  
                 //scale 是缩小图片到设置的大小，image是图片的原来大小
                objDivFilter.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = fileUrl;                            
            } 
        } 
    function closewin()
   {
      window.returnValue   =encodeURIComponent( "<%=FileName%>");
      window.close(); 
   }

    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
       <input id="File1" runat ="server"  type="file"  onchange="javascript:setImagePreview( this.value );"  />
        <asp:Button  id="btnUpload" Text="上传"  runat ="server"  style="height: 22px" OnClick="btnUpload_Click" />
        <div id="divFilter" >
            </div></div>
    </form>
</body>
</html>
