Posted by Jayce Ooi as Programming
For example, you create a button with ‘Button1′ as its ID. Its name will still be ‘Button1′ under normal HTML. However, its name changes if you use ASP.NET MasterPage. It will change to ‘ctl00$Button1′ from ‘Button1′. You can find that out when you see its source code using Internet Explorer / Firefox view source function.
You can change the Content Place Holder ID in properties window. However, we cannot do so on Master Page. You need to add a Page_Init() function for your Master Page in C#.
protected void Page_Init( object sender, EventArgs e )
// this must be done in Page_Init or the controls
// will still use “ctl00_xxx“, instead of “MasterPageID_xxx”
this.ID = “MasterPageID”;
You will get ‘MasterPageID$ContentPlaceHolder1$Button1′ as your button ID then.