如果你的属性添加过程是在Page_Load中或者是Page_Init中的就不会丢失了。

解决方案 »

  1.   

    if you view the html source, you will see those attributes are never output to the client side, you can subclass DropDownList and override RenderControl methodor you can use HtmlSelect control, see
    BUG: Attributes Property of ListItem Only Works Within an HtmlSelect Control
    http://support.microsoft.com/default.aspx?scid=kb;en-us;Q309338
      

  2.   

    saucer(思归) :
    使用html的方式,就要使用脚本来控制(我的一般做法),这无疑要增加代码的复杂性。aspx的服务端有办法保留自定义属性吗,不屏蔽其原有的。