日期:2014-05-17  浏览次数:20407 次

请教一个在后台设置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