1. Put an upload control and an image control on the page.
<Asp: fileupload id = "fileupload1" runat = "server" onpropertychange = "show (this. Value)"/>
<Asp: Image id = "image1" runat = "server"/>
2. Write the onpropertychange = "show (this. Value)" event in the upload control, call the show function in JS, and pass its parameters to Js.
<SCRIPT type = "text/JavaScript">
Function show (ID)
...{
Document. getelementbyid ("image1"). src = ID;
}
</SCRIPT>
IE6, IE7 passed the test (Note: implement through filter)
<Div id = "divview" style = "filter: progid: DXImageTransform. Microsoft. alphaimageloader (sizingmethod = image); width: 166px; Height: pixel PX">
<! -- Used to display images -->
</Div>
<Asp: fileupload id = "fileupload3" runat = "server" onpropertychange = "show1 (this. Value)"/>
<SCRIPT type = "text/JavaScript">
Function show1 (upimg)
...{
VaR dd = Document. getelementbyid ("divview ");
Dd. Filters. Item ("DXImageTransform. Microsoft. alphaimageloader"). src = upimg;
Dd. style. width = 166;
Dd. style. Height = 190;
Dd. Filters. Item ("DXImageTransform. Microsoft. alphaimageloader"). sizingmethod = 'Scale ';
}
</SCRIPT>