The ID of a control, such as a <div runat='server' id='root'>, can be specified directly in the .aspx file. But what if the ID needs to change dynamically? For example, wth the YUI tookit you use the ID attribute of the root div to specify the page template, and you may want the template to change based on a user's preference.
In the code behind file, you may try changing the ID by writing something like root.ID = "doc3". This may work, but if your control is in a naming container (such as a MasterPage) the control will render more like <div id='ctrl00$doc3'>. There is a way to take complete control of the attribute, however:
root.ID = null;
root.Attributes["id"] = "doc3";
If you don't set the ID property to null then two ID attributes are rendered: not what you want, and not valid HTML.