I often create web pages where everything I display, such as radio buttons, text boxes and labels, is dynamically generated from the aspx.cs page. At other times I create everything on the aspx page using the GUI designer. I now want to do both. How do I generate something on the backend and put it in a specific place on the page that already has other HTML components?
Mixing Server generated HTML and GUI Design HTML
Collapse
X
-
Originally posted by joatmanI often create web pages where everything I display, such as radio buttons, text boxes and labels, is dynamically generated from the aspx.cs page. At other times I create everything on the aspx page using the GUI designer. I now want to do both. How do I generate something on the backend and put it in a specific place on the page that already has other HTML components?
Eg:
[code=asp]
<!--html content-->
<asp:Panel runat="server" id="PlaceHolder ForRadioButtons "></asp:Panel>
<!--more html-->
<asp:Panel runat="server" id="PlaceHolder ForTextBoxes"></asp:Panel>
[/code]
Then you just add your dynamically created controls by calling the Panel.Controls. Add property....
[code=vbnet]
'.....dynamical ly created RadioButtonList in code already...
PlaceHolderForR adioButtons.Con trols.Add(myDyn amicRadioButton s)
[/code]
Cheers!
-Frinny
Comment