N
nLL
Hi everyone, I am developing a simple poll/voting application and i need
to programmatically add choices/options as user clicks to add new choice
button.
I have
Poll question text box
First poll answer/choice with id choice1 in Choices Placeholder
Add new choice button.
When add new choice button clicked, i want to get id of last textbox
control in Choice Placeholder and add new textbox control with
incremented id.
here is the code side of it
-----------------
Poll question:
<asp:TextBox ID="PollQuestionText" runat="server"></asp:TextBox><br />
<asplaceHolder ID="PollAnswers" runat="server">
<asp:Label ID="PollAnswerLabel1" runat="server" Text="Choice
1"></asp:Label>: <asp:TextBox ID="PollAnswer1" runat="server"></asp:TextBox>
<!-- INSERT NEW TEXTBOX CONTROL HERE AS ADD NEW BUTTON CLICKED-->
</asplaceHolder>
<asp:Button ID="addChoiceButton" runat="server" Text="Add new choice"
onclick="addChoiceButton_Click" />
<asp:Button ID="SaveButton" runat="server" Text="Save" />
--------------------------------------------------
This will be a mobile web app so I can't use javascript.
Could any one point me to the right direction?
Thanks
to programmatically add choices/options as user clicks to add new choice
button.
I have
Poll question text box
First poll answer/choice with id choice1 in Choices Placeholder
Add new choice button.
When add new choice button clicked, i want to get id of last textbox
control in Choice Placeholder and add new textbox control with
incremented id.
here is the code side of it
-----------------
Poll question:
<asp:TextBox ID="PollQuestionText" runat="server"></asp:TextBox><br />
<asplaceHolder ID="PollAnswers" runat="server">
<asp:Label ID="PollAnswerLabel1" runat="server" Text="Choice
1"></asp:Label>: <asp:TextBox ID="PollAnswer1" runat="server"></asp:TextBox>
<!-- INSERT NEW TEXTBOX CONTROL HERE AS ADD NEW BUTTON CLICKED-->
</asplaceHolder>
<asp:Button ID="addChoiceButton" runat="server" Text="Add new choice"
onclick="addChoiceButton_Click" />
<asp:Button ID="SaveButton" runat="server" Text="Save" />
--------------------------------------------------
This will be a mobile web app so I can't use javascript.
Could any one point me to the right direction?
Thanks