Last post Jun 08, 2008 05:24 PM by jkirkerx
Jun 08, 2008 11:50 AM|neilredfern|LINK
I'm currently looking for some controls that render readonly content as span's rather than the original control. i.e. a readonly textbox would be rendered as <span>Text Value</span> rather than <input type="text" value="Text Value" />. I started implementing
the textbox example myself which works fine until I brought validators into the equation which fail if the textbox is empty.
Does anyone have any thoughts about a control library that does this?
Jun 08, 2008 03:26 PM|anas|LINK
Jun 08, 2008 03:40 PM|neilredfern|LINK
This is how we are currently working though this is a time cunsuming task as when we add new pages into the system or new fields onto a existing page. This also leads to a lot of unnecessary code which is just performing the same task of detecting whether
the page should be readonly and if so hiding the current input field and displaying a label instead.
The way I see it a group of controls which inherit of the standard textbox, dropdownlist, checkbox(s) and radio button(s) would provide this functionaility without all the code.
Jun 08, 2008 04:03 PM|anas|LINK
I think the best solution is to write a userControl , create a public proeprty for that control and let the usercontrol behave based on that property ,
so if you need a readonly text , you set the property value to readonly , which inform the usercontrol to render as a label ,
And set that property to Edit , to inform the label to render as textbox !
Jun 08, 2008 05:24 PM|jkirkerx|LINK
The label Control just renders <span></span> tags.
The panel control just renders <div></div> tags.
Most controls don't really do anything special, but just render common tags in the proper format, HTML 4.0, XHTML 1.0, whatever you set the WebForm To.