我创造HtmlGenericControl
像这样 :
HtmlGenericControl inner_li = new HtmlGenericControl("li");
inner_li.Attributes.Add("style", "list-style-type: none");
我怎样才能得到这个属性的值(style
).
您可以使用索引器来做到这一点:
var style = inner_li.Attributes["style"];
只是一个旁注:在处理样式时最好使用HtmlControl.Style http://msdn.microsoft.com/en-us/library/d53fws1t%28v=vs.100%29.aspx财产:
inner_li.Style[HtmlTextWriterStyle.ListStyleType] = "none";
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)