各位大哥,请听小弟慢慢讲:
          运行环境ASP。NET;
          WINDOWS200 SERVER
     在用imagebutton时,本地运行成功,显示图片,但是在网络上确不能显示图片,换控件测试IMAGE,结果可以显示,非常懊恼,因为没有办法在服务器测试,
    
    在线等,非常感谢!

解决方案 »

  1.   

    把aspx文件的相关内容拿出来看看
      

  2.   

    不用了,我改好了,
    原来是相对路径和绝对路径的关系,
    原方法:
    dim strPhotoNmae as String = "test1.jpg"
    ImageButtonTest.ImageUrl = Server.MapPath("..\Image\Photo\") & strPhotoNmae 
    在html中显示:src="D:\Inetpub\wwwroot\Huasang\Image\Photo\test1.jpg"
    其中D:\Inetpub\wwwroot\Huasang为服务器上,文件存在位置改进方法:
    private const STR_PHOTO_URL  as String = "..\Image\Photo\"
    ImageButtonTest.ImageUrl = STR_PHOTO_URL & strPhotoNmae 
    在html中显示:src="..\Image\Photo\test1.jpg"这样就可以显示了,解决方法写在这里,希望对大家有所帮助!谢谢您的帮助,effun(一风)先生!