每一個控制項,都會有一個ID以供辨識
下面範例介紹列出所有控制項ID
void Page_Load(object sender,EventArgs e)
{
Response.Write("Control_ClientID Sample");
// Get the list of all controls.
IEnumerator myEnumerator = Controls.GetEnumerator();
Response.Write("Enumerating Controls Collection");
while(myEnumerator.MoveNext())
{
Control myControl = (Control) myEnumerator.Current;
// Display the ClientID property
Response.Write("The ClientID property of Control : " + myControl.ClientID);
}
}
沒有留言:
張貼留言