<legend>Organisation /Company Contacts</legend> <asp:ScriptManager ID="scrptmgr1" runat="server" /> <asp:UpdatePanel ID="updatepnl1" runat="server" UpdateMode="Conditional"> <triggers> <asp:AsyncPostBackTrigger ControlID="btn1" EventName="Click" /> </triggers> <contenttemplate> <asp:Table ID="tbl1" runat="server" Height="48px" Width="330px"> <asp:TableRow ID="tr1" runat="server"> <asp:TableCell ID="r1_tc1" runat="server"> <asp:Label ID="regdet_llno_lbl" runat="server">Land Line Number: <asp:TableCell ID="r1_tc2" runat="server" RowSpan="2"> <asp:TextBox ID="regdet_llno_txt" runat="server" /> <asp:RegularExpressionValidator ID="validator1" runat="server" ControlToValidate="regdet_llno_txt" ErrorMessage="Only numbers are allowed" ValidationExpression="^\d+$"> <asp:TableCell ID="r1_tc3" runat="server"> <asp:Button ID="btn1" runat="server" Text="add" CausesValidation="false" OnClick="btn1_Click" /> </contenttemplate>
protected void btn1_Click(object sender, EventArgs e) { int a = 3; for (; a <= 5; a++) { TextBox lndline = new TextBox(); lndline.ID = "lndline_txt" + a; r1_tc2.Controls.Add(lndline); Literal li1 = new Literal(); li1.Text = ""; r1_tc2.Controls.Add(li1); } int b = 1; if (b==1) { btn1.Enabled = false; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)