Obtain the implementation method of ID and Name on the client side of asp. net server control

  • 2021-07-22 09:28:38
  • OfStack

A few days ago, when I was doing the project, I encountered a problem and wanted to check the name attribute displayed by the server control in Asp. net on the client. At first, I didn't feel hard to find, but I just couldn't find it. After many twists and turns, I finally found it:


string btnClientName = btnSearch.UniqueID;// Object displayed by the server control on the client name Attribute 

string btnClientID = btnSearch.ClientID;// Object displayed by the server control on the client id Attribute 

Related articles: