我写一个自定义控件,将动态生成多个文本框,每个文本框都使用一个相同的背景图片(用CssClass属性定义)tb.CssClass = "txt_hid";样式表如下:
.txt_hid
{
border-style:none;
width:95;
background:url(images/txt_back.gif);
}我发现在页面载入时生成多少个文本框,这个背景图片就载入多少次,极大的影响了速度,
请问有没有办法让这个图片只载入一次.

解决方案 »

  1.   

    http://search.csdn.net/Expert/topic/1984/1984489.xml?temp=.2794611
    http://search.csdn.net/Expert/topic/1266/1266524.xml?temp=.4042932
    这两个都不合适,因为:我的文本框必须使用CSS类控制样式,不能用脚本
      

  2.   

    http://search.csdn.net/Expert/topic/481/481094.xml?temp=8.852786E-02
      

  3.   

    不要用background,用background-Image
      

  4.   

    楼上正解,background-image应该可以
      

  5.   

    试了一下,用background-Image也不行!