Code
<% @ Page Language = "C #" AutoEventWireup = "true" %>
<! 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 runat = "server">
<Title> No title page </title>
<Style type = "text/css">
# NewPreview {}{
FILTER: progid: DXImageTransform. Microsoft. AlphaImageLoader (sizingMethod = scale );
}
</Style>
</Head>
<Body>
<Form id = "form1" runat = "server">
<Div>
<! -- IE6 and IE7 are supported, but Firefox2.0 is not supported. other browsers are not tested. -->
<Script type = "text/javascript">
Function CloseWin ()
{
Window. opener = null;
Window. open ("", "_ self ");
Window. close ();
}
Function Preview (imgFile)
{
Document. getElementById ("pic"). filters. item ("DXImageTransform. Microsoft. AlphaImageLoader"). src = imgFile. value;
}
</Script>
<A href = "javascript: CloseWin ();"> click here to close the current window. </a> <br>
<Asp: FileUpload ID = "FileUpload1" runat = "server" onchange = "javascript: Preview (this);"/>
Select the image to preview: <br>
<Div id = "pic" style = "filter: progid: DXImageTransform. Microsoft. AlphaImageLoader (sizingMethod = scale); width: 400px; height: 200px;"> </div>
</Div>
</Form>
</Body>
</Html>