Id, the difference between clientid and uniqueid, clientiduniqueid
I,
ID is the ID specified during design.
ClientID is used when the control is generated on the client page and accessed by the client.
UniqueID is used when you need to participate in server return.
Note:When a control is a subcontrol (for example, a Button in a user control), ClientID is used as the control's ID attribute on the HTML page, and UniqueID is used as the control's Name attribute, if it is not a child control, the ClientID and UniqueID are the same.
For example:
MyControl1 is a user control that contains a button with the ID of Button1 and runs MyControl1 on a page. The following is the HTML code of the page.
<input type="submit" name="MyControl1:Button1" value="Button" id="MyControl1_Button1" />ClientID:MyControl1_Button1 UniqueID:MyControl1:Button1
Supplement:To write client Event code for a control in a user control, you must obtain the ClientID of the control if you want to write it in the control.
Ii. ASP. NET Server-side controls have three ID-related property IDs: ClientID and UniqueID..
ID
Indicates the identifier of the control's server-side programming. This ID is required for writing the server-side code, this ID allows you to program access to the properties, methods, and time of the server-side controls on the server.
ClientID
The ID of the client control generated by the server. It is often used to access the HTML elements displayed by the server control in the client script.
Generally, it is the same as the server ID. Sometimes, it cannot generate a unique name for the control. For example:
If the Repeater space contains a Label control in a template, multiple HTML elements of the Label are generated on the client,
ASP. NET generates a unique ClientID for each server control. ClientID is generated by connecting the UniqueID value of the parent control of the Child control with the ID value of the control.
UniqueID
Obtains the unique, hierarchical identifier of a server control.
When you place controls in repeated controls (Repeater, DataList, and DataGrid), multiple server-side controls may be generated, which requires distinguishing the various controls on the server, so that their ID attributes do not conflict.
UniqueID is generated by connecting the UniqueID value of the parent control of the Child control with the ID value of the control. Each part is connected by the character specified by the IdSeparator attribute.
By default, the IdSeparator attribute is a colon character (:). This attribute is newly added in. Net Framework2.0.