C# asp.net Why is there a difference between ClientID and UniqueID?

前端 未结 2 1567
不思量自难忘°
不思量自难忘° 2020-12-09 16:39

I know ClientID is used for javascript and UniqueId for server side and that ClientID uses an underscore (_) and UniqueId uses a dollar sign ($) in asp.net 2.0. But what I d

2条回答
  •  难免孤独
    2020-12-09 17:12

    this.UniqueID is the control's name appended with all naming containers, think of it as the fully qualified control name. this.ClientID is the value that will appear in the id attribute of the control, it is a translation of the uniqueid to be a (well almost) html compliant id tag (leading underscores are not really html compliant).

提交回复
热议问题