G
Guest
H
I'm struggling to think this one through
At run time I want to be able to read a layout HTML file from a database which includes tags for modules, e.g
<HTML><BODY><table><tr><td><ModuleTag>1</ModuleTag></td><td><ModuleTag>2</ModuleTag></td></tr></table></BODY></HTML
I would then like to, at run time, interpret the module tags and replace them with custom web controls (e.g., Announcement, Article). The reason for doing this at run time is that I do not know the structure of the layout (there could be more tags placed in a more complex layout)
I could tackle it as follows
* Have a page (Page.aspx) with a PlaceHolder (phLayout)
* Split the layout html at the module tags to end up with a collection of controls (literals and custom
- Literal1 = "<HTML><BODY><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"width=\"100%\"><tr><td>
- CustomWebControl1 = Module
- Literal2 = "</td><td>
- CustomWebControl2 = Module
- Literal3 = "</td></tr></table></BODY></HTML>
* Add the controls to the placeholde
Is there a simpler way
Thanks
Steven
I'm struggling to think this one through
At run time I want to be able to read a layout HTML file from a database which includes tags for modules, e.g
<HTML><BODY><table><tr><td><ModuleTag>1</ModuleTag></td><td><ModuleTag>2</ModuleTag></td></tr></table></BODY></HTML
I would then like to, at run time, interpret the module tags and replace them with custom web controls (e.g., Announcement, Article). The reason for doing this at run time is that I do not know the structure of the layout (there could be more tags placed in a more complex layout)
I could tackle it as follows
* Have a page (Page.aspx) with a PlaceHolder (phLayout)
* Split the layout html at the module tags to end up with a collection of controls (literals and custom
- Literal1 = "<HTML><BODY><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"width=\"100%\"><tr><td>
- CustomWebControl1 = Module
- Literal2 = "</td><td>
- CustomWebControl2 = Module
- Literal3 = "</td></tr></table></BODY></HTML>
* Add the controls to the placeholde
Is there a simpler way
Thanks
Steven