ID vs UniqueID vs ClientID vs UniqueClientID vs StaticClientID?

前端 未结 3 1571
逝去的感伤
逝去的感伤 2021-01-02 09:57

Okay, I\'m pretty confused about the IDs of dynamically created controls.

Public Class TestClass
    Inherits Panel
    Implements INamingContainer

    Func         


        
3条回答
  •  悲&欢浪女
    2021-01-02 10:08

    The ClientIDMode was added to ASP.NET 4 to allow control if you want it. It is particularly useful for client side libraries such as jQuery. ASP.NET's magic hinges on the uniqueness of controls. If you decided to use Static make sure they are unique, as you may face some unexpected runtime errors down the road.

提交回复
热议问题