ASP.NET dynamically created controls and Postback

I know this question has been asked thousands of times, and I’ve struggled with it before, but for some reason, I can’t accomplish what I want to accomplish… I have a dynamically added LinkButton that when clicked will dynamically add a control (in this example, a textbox) to the same panel. The intent is to continuously add on as many controls as times the LinkButton was clicked (i.e. I click it once, one box, then another click will give me 2 boxes, another click adds a 3rd). In the code below, I use the current date and time serialized to create a unique ID for each textbox control.

Confirm postback OnClientClick button ASP.NET

<asp:Button runat="server" ID="btnUserDelete" Text="Delete" CssClass="GreenLightButton" OnClick="BtnUserDelete_Click" OnClientClick="return UserDeleteConfirmation();" meta:resourcekey="BtnUserDeleteResource1" /> I have tried: function UserDeleteConfirmation() { if (confirm("Are you sure you want to delete this user?")) return true; else return false; } and function UserDeleteConfirmation() { if (confirm("Are you sure you want to delete this user?")) { __doPostBack(btnUserDelete, ''); } return false; } And none … Read more