Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Import Namespace="System.Collections"%>
- <%@ Import Namespace="System.Collections.Generic"%>
- <%@ Page Language="C#"%>
- <html>
- <head>
- <style type="text/css">
- body
- {
- font-family: Calibri;
- font-size: 13px;
- }
- </style>
- <script runat="server">
- public void cmdSubmit_Click(object Sender, EventArgs e)
- {
- Dictionary<int, String> textValues = new Dictionary<int, String>();
- foreach(RepeaterItem rptrItem in rptTest.Items)
- {
- TextBox txtEntry = (rptrItem.FindControl("txtEntry") as TextBox);
- textValues.Add(rptrItem.ItemIndex, txtEntry.Text);
- }
- textValues.Add(textValues.Count, "");
- rptTest.DataSource = textValues;
- rptTest.DataBind();
- }
- </script>
- </head>
- <body>
- <form runat="server">
- <asp:Repeater id="rptTest" runat="server">
- <ItemTemplate>
- <div>
- Enter Value Here: <asp:TextBox ID="txtEntry" runat="server" Text='<%# Eval("Value") %>'></asp:TextBox>
- </div>
- </ItemTemplate>
- </asp:Repeater>
- <asp:Button id="cmdSubmit" runat="server" Text="Add Textbox" OnClick="cmdSubmit_Click"/>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement