日期:2014-05-19  浏览次数:20502 次

(新手)能把.net控件里的style属性抽出来吗?
<tr>
  <td   style= "width:   100px; "   class= "list1 ">
  <span   style= "font-size:   10.5pt;   font-family:   宋体;   mso-bidi-font-size:   12.0pt;   mso-ascii-font-family:   'Times   New   Roman ';mso-hansi-font-family:   'Times   New   Roman ';   mso-bidi-font-family:   'Times   New   Roman ';
mso-font-kerning:   1.0pt;   mso-ansi-language:   EN-US;   mso-fareast-language:   ZH-CN;   mso-bidi-language:   AR-SA; "   > <a   href   = "../studentLogin.aspx "   > 个人信息 </a> </span> </td>
        </tr>
        <tr>
<td   style= "width:   100px;   height:   18px; "   class= "list2 ">
<span   style= "font-size:   10.5pt;   font-family:   宋体;   mso-bidi-font-size:   12.0pt;   mso-ascii-font-family:   'Times   New   Roman ';mso-hansi-font-family:   'Times   New   Roman ';   mso-bidi-font-family:   'Times   New   Roman ';
mso-font-kerning:   1.0pt;   mso-ansi-language:   EN-US;   mso-fareast-language:   ZH-CN;mso-bidi-language:   AR-SA "> <a   href   = "../teacherList.aspx "   > 讲师列表 </a> </span> </td> </tr>

控件里的style属性很多重复..
span   style= "font-size:   10.5pt;   font-family:   宋体;   mso-bidi-font-size:   12.0pt;   mso-ascii-font-family:   'Times   New   Roman ';mso-hansi-font-family:   'Times   New   Roman ';   mso-bidi-font-family:   'Times   New   Roman ';
mso-font-kerning:   1.0pt;   mso-ansi-language:   EN-US;   mso-fareast-language:   ZH-CN;   mso-bidi-language:   AR-SA; "  
这就重复两次

我想抽到css文件里去,或者其它方法也可以

------解决方案--------------------
可以啊 在css里面定义class

------解决方案--------------------
<style>
.spanStyle
{
font-size: 10.5pt;
...
}
</style>

<span class= "spanStyle "> </span>

------解决方案--------------------
cssclass
------解决方案--------------------
在后台写!
page.registerstartupscript( "随便名 "document.getElementById(想要取属性的哪个空间的ID).style )
------解决方案--------------------
.net2005新有特性
可以与样式外观分离开来
我有些资料可以向我索取

QQ:380326576