The setup: Web form with lots of TextBox controls.
When I set any one of the TextBox control’s Enabled property to False, I’d like to “swap” that TextBox out for a label at runtime. The idea here being if it’s read only anyway, don’t display it in a control designed for editing.
I’m thinking this should be pretty simple and reusable, but what’s the best way to do this?
Not sure its the best way, I would make a custom server control is a textbox,
then override the render method, check if it is readonly,
if it is read only then render your span tags like a label controls does.
if not then let the base( textbox ) render take over…