Label and Literal Control - Course ASP. NET 4 and Visual Studio 2010 - Lesson 2 (free video)
In this video, we are covering three points: Control tree, AssociatedControlId, and Literal control. First we start with the control tree. To do that, we created a page that contains few controls (label, dropdownlist, and a button). Then we added trace=true to the page so that the trace information will show when we load the page into the browser. This trace information is very helpful for debugging specially when we look at the control tree and see how the page is structures. Next, we look at the label control. We created a label control with a textbox. We view the source in the browser and see that the label turns into a span tag with all the properties that we set. After that, we added the property AssociatedControlId to associate the label with the textbox (helpful for hearing aid technologies). Doing that help us see the label staying as a label when displayed into the browser (instead of a span).