我的代码如下:
<input type="button" style="BACKGROUND-IMAGE: url(image\calendar.gif);WIDTH: 27px;HEIGHT: 24px" onclick="calendar(document.Form1.tbInvoiceSendDate)" id="Button1" runat="server"/>原来在.net2003下运行正常,现在升级到.Net2005后,在设计时就看不到按钮的图片了,但程序运行一切正常,请教各位是什么原因?
谢谢

解决方案 »

  1.   

    image\calendar.gif 你用了绝对路径了吧
      

  2.   

    老大。路径错了。image\calendar.gif   是用image/calendar.gif
      

  3.   

    说明:
    1.image是跟bin目录同一级的
    2.这个图片地址http://192.168.100.3/payee/image/calendar.gif是可以访问的,改成使用这个也是没有没有显示,但是在设计时,在“样式生成器”中可以看到图片
    代码如下:
    <input onclick="calendar(document.Form1.tbGatheringInputDate)" type="button" runat="server" style="width: 27px; height: 24px; background-image: url(http://192.168.100.3/payee/image/calendar.gif);"/>
      

  4.   

    因为我的控件需要执行命令“calendar(document.Form1.tbGatheringInputDate)" ,改成Image是可以显示图片,但点击时,出现的控件闪一下就没有了,我的代码如下:
    <input type="image" onclick="calendar(document.Form1.tbGatheringInputDate)" id="Image1" src="Image/calendar.gif" />
    改成服务器控件也不行还请各位多多指教
      

  5.   

    <input type="image" onclick="calendar(document.Form1.tbGatheringInputDate)" id="Image1" src="../Image/calendar.gif" /> 
    在image前面加"../"
      

  6.   

    你就用button就可以了,不要听楼上的说。
    还有你不是看不到按钮了,而是按钮的背景图片看不到了,对吧?那是因为你设置的有问题,解决这个问题有2中办法,你可以用服务器端的ImageButon,这个就不用我多说了。你的代码可以加个属性就可以了
    <input type="button" style="BACKGROUND-IMAGE:url(image\calendar.gif);background-color:Transparent;WIDTH: 27px;HEIGHT: 24px" onclick="calendar(document.Form1.tbInvoiceSendDate)" id="Button1" runat="server"/> 
      

  7.   

    g497772921:
    1.<input type="image" onclick="calendar(document.Form1.tbGatheringInputDate)" id="Image1" src="Image/calendar.gif" /> 
    可以正常显示图片.
    是点击时,出现的控件闪一下就没有了。
      

  8.   

    yxzbest,谢谢你,问题解决。
    其实就是要将背景色设置为透明就可以了.