当前位置: 代码迷 >> ASP.NET >> 请问一个在后台设置input type="text"的class的有关问题
  详细解决方案

请问一个在后台设置input type="text"的class的有关问题

热度:7807   发布时间:2013-02-25 00:00:00.0
请教一个在后台设置input type="text"的class的问题
样式表:
C# code
.imgbutton{    background: url(images/wxzw.jpg);    border-style: none;    width: 16px;    height: 15px;    background-repeat: no-repeat;    cursor: pointer;    font-size: 1px;    text-decoration: none;}.imgbutton2{    background: url(images/xzzw.jpg);    border-style: none;    width: 16px;    height: 15px;    background-repeat: no-repeat;    cursor: pointer;    font-size: 1px;    text-decoration: none;}

前台:
C# code
<input type="text" id="t1p1z11" name="t1p1z11" class="imgbutton" value="0" readonly="readonly">

我要如何在后台设置或者说改变这个input type="text"的class?

------解决方案--------------------------------------------------------
C# code
<input type="text" id="t1p1z11" name="t1p1z11" class="imgbutton" value="0" readonly="readonly" runat="server">t1p1z11.Attributes["class"] = "imgbutton2";
------解决方案--------------------------------------------------------
= =楼主真坏。。用了我的建议一分没给我 5555
  相关解决方案