When building custom server controls sometimes it is nice to eliminate the need for a post back. I say nice but not necessarily easy. Perhaps you would like to enter dollar amounts into textboxes within grid rows and display the total on the last row all without a post back. This really isn't that hard using a little Java Script. For example, you can use the OnChange event for the ASP.NET Textbox control to call a JavaScript function to update the total. However, what I found a little challenging was figuring out how to access an ASP.NET Label control via Java Script. This control renders as a html tag. After some Google searching I found a method that works quite well.
Let's say you have a label control where the id=Errors. It will essentially render as . You can access and change the text of this label via Java Script as follows:
document.getElementById('Errors').innerHTML = 'Must be a numeric value';
The above line of code will work in IE5, IE6, NS6