asp.net与javascript

给html element添加atrribute,包括javascript字符串截取

code snippet:

e.Row.Attributes.Add("onmouseover", "if(this.className.indexOf('project-listitem-selected')<0)this.className+=' project-listitem-mouseover'");
 

e.Row.Attributes.Add("onmouseout", "if(this.className.indexOf('project-listitem-selected')<0)this.className=this.className.substring(0,this.className.indexOf(' project-listitem-mouseover'))");

原文地址:https://www.cnblogs.com/guojin705/p/1270658.html