Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Dynamically adding controls in markup?

$
0
0

Im having trouble with adding controls based on a dropdown menu selection. I know this is quite a common feature, and Ive seen it answered on a few threads, but the page im using has no code behind page, which seems to make the issue more difficult.

I have set the text boxes in question to not visible:

Add response options:<asp:TextBox ID="rspnseBx1" runat="server" Visible="False"></asp:TextBox><asp:TextBox ID="rspnseBx2" runat="server" Visible="False"></asp:TextBox><asp:TextBox ID="rspnseBx3" runat="server" Visible="False"></asp:TextBox><asp:TextBox ID="rspnseBx4" runat="server" Visible="False"></asp:TextBox></p><p>
        Add option values:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBox ID="valueBx1" runat="server" Visible="False"></asp:TextBox><asp:TextBox ID="valueBx2" runat="server" Visible="False"></asp:TextBox><asp:TextBox ID="valueBx3" runat="server" Visible="False"></asp:TextBox><asp:TextBox ID="valueBx4" runat="server" Visible="False"></asp:TextBox>

I am looking to make these appear when a certain selection from this drop down is selected i.e. the "dropdown" value

 Select your response type:<asp:DropDownList ID="responseDrpDwn" runat="server"><asp:ListItem>--Please Select--</asp:ListItem><asp:ListItem>Text</asp:ListItem><asp:ListItem>DropDown</asp:ListItem><asp:ListItem>RadioButton</asp:ListItem></asp:DropDownList><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
            ControlToValidate="responseDrpDwn" ErrorMessage="Please select a response type" 
            InitialValue="--Please Select--"></asp:RequiredFieldValidator> <%--required field validator using an initial value to validate from--%>

Can this be done without a code behind page?

Thank You :)

 


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>