Set ClientID in asp.net

前端 未结 7 1635
情话喂你
情话喂你 2020-12-19 03:28

Is it possible to set the ClientID of any asp.net server control? How can I do this?

7条回答
  •  情书的邮戳
    2020-12-19 04:12

    I would advice against doing this unless you are sure you want to do it, but there is a way. You can override the ClientID property from within the server control.

    public override string ClientID
    {
        get { return "whatever"; }
    }
    

    But as others have noted, you can't do it from outside.

提交回复
热议问题