The issue is that whenever we bound to textboxes in Multiline mode, the data would save correctly to the database but not render correctly. This effectively meant that our app would clear out all data in multiline textboxes if you save it twice. Now where I come from, Data loss is a basic no-no :o)
If you look at the code below, it all looks perfectly innocent. You render the begin tag, the contents and then the end tag. A few of the guys had a look at this and didn't know why the data was being erased and just avoided using the custom control - using the asp:TextBox instead :
protected override void Render(HtmlTextWriter writer)
// Assumes validator control has been added as a subcontrol
Looks fine? No. If you look at the base class in reflector (TextBox.Render(HtmlTextWriter)), you will see what is wrong with the code above:
protected internal override void Render(HtmlTextWriter writer)
if (this.TextMode == TextBoxMode.MultiLine)
So the HTML textareas being rendered by the extended control were blank as the control was omitting an essential step in the render method. I just entered the multiline condition into the inherited control - and everything worked fine.