What's the best way to deal with ASP.NET's ClientID

后端 未结 4 1841
闹比i
闹比i 2021-01-15 03:55

I\'m trying to find the best way to deal with the way that ASP.NET prepends a value to any element that is created with runat=\"server\", without having to reso

4条回答
  •  抹茶落季
    2021-01-15 04:11

    If you are using .Net framework 4.0 or higher ,Use the ClientIDMode property of the Control

    You may use Static as the ClientIDModeEnumeration

    The ClientID value is set to the value of the ID property. If the control is a naming container, the control is used as the top of the hierarchy of naming containers for any controls that it contains.

提交回复
热议问题