Forcing client ids in ASP.NET

后端 未结 6 584
滥情空心
滥情空心 2020-12-22 12:27

I know that in the next version of ASP.NET we\'ll finally be able to set the clientids on System.Web controls without the framework doing it for us in a quasi-intelligent wa

6条回答
  •  清歌不尽
    2020-12-22 13:00

    What I tend to do is dynamically generate javascript methods which handle this. You can do this in markup or code behind so for example:

    
    

    You can also build the functions in the code behind and register them.

    EDIT

    A couple months ago I needed to fix the id of some server controls, I managed to hack it in and I described my method here here.

    Basically you need put the controls inside a naming container like a user control, and then override a couple of properties which prevents the child controls from getting their uniqueid.

提交回复
热议问题