Eval script for server side control's ID property?

后端 未结 6 1303
暗喜
暗喜 2020-12-07 05:36

Using the following Eval script for setting ID property causes error. Error message: the server tag is not well formed.

 

        
6条回答
  •  日久生厌
    2020-12-07 06:05

    As Silky said, you can't do this. The attributes can't be dynamic in none code behind. One solution is to subclass the Panel:

    public class MyPanel : Panel
    {
        public override string ID
        {
            get
            {
                return "get from my datasource";
            }
            set
            {
                // noop
            }
        }
    }
    

提交回复
热议问题