What is the difference between UniqueID and ClientID?

 Posted by Virendradugar on 12/16/2009 | Category: ASP.NET Interview questions | Views: 6336

Well, both the properties are associated with asp.net control. The difference is Unique ID has '$' (Dollar) sign and Client ID adds '_' (hyphen) to the control, if master page is used.

Let's say you have placed a text box called 'txtName' in content place holder. So client ID will be ct100_ContentPlaceHolder1_txtName where Unique ID will be ct100$ContentPlaceHolder1$txtName.

ClientID is used to access control in Java Script where using Unique ID you can make a post back using java script __doPostBack() function.

Virendra Dugar

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response