日期:2014-05-17  浏览次数:20419 次

.net 上传图片预览功能
如题,为什么我的图片选择之后看不到图片的预览呢,现在我贴上代码,请各位指导一下

               <td align="left">
                        <asp:FileUpload ID="image_file" runat="server" onchange="previewpic(this)" Height="21px"                                Width="188px" />
                        
                                <br />
                                     <script type="text/javascript">
                                         function previewpic(obj) {
                                             var preview = document.getElementById("preView");
                                             preview.src = obj.value;
                                         }                         
                        </script>
                        
                        <img id="preView" style="width: 165px; height: 119px" />                        </td>