我用HtmlInputFile控件选择一张图片,但该图片不会立即显示在网页上,请问有何方法能够在选择图片后立即将图片显示在网页上或者控件中?

解决方案 »

  1.   

    可以在
    HtmlInputFile的onpropertychange="imgID.src=escape(this.value)"
      

  2.   

    可以在
    HtmlInputFile的onpropertychange事件里做
    onpropertychange="imgID.src='file:///'+escape(this.value)"
      

  3.   

    如果在服务器端显示,保存成文件,直接显示出来就可以了<img src="x.jpg">
      

  4.   

    onpropertychange这个事件在哪里阿,没有找到
      

  5.   

    <body>
    <input type=file onpropertychange="document.all.imgID.src='file:///'+(this.value)"><br>
    <img id=imgID src="">
    </body>
      

  6.   

    还有一个问题,我用Txtbox的TextChanged事件,触发了以后,刚才选择的图片就没有了,这该怎么办呢