Dynamically add table rows by selecting value from DropdownList - not working correctly
-
Greetings again dear experts. We have a working code that dynamically adds a new row to html table by clicking an Add Row button using gridview. A user can add rows or remove rows. This has worked great now for quite some time. However, we have now been tasked with using DropDownList to row the rows dynamically. For example, we have a dropdown with 5 values, 1 through 5. 1 is selected by default form the dropdown and one empty row is displayed. If a user selects two from the dropdown, 2 rows are displayed, etc. I have a code I can't get to work correctly. By that I mean, dropdown has a default value of 1 but no rows are displayed. Even worse, when you select say two from the dropdown, you get inconsistent number of rows displayed. Finally, when you click to remove rows, it removes everything, not just the row you wish to remove. I am a bit stumped. Your assistance is greatly appreciated.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="toilets.aspx.vb" Inherits="toilets" %>
<%@ Register Src="~/UserControl.ascx" TagName="UserControl" TagPrefix="uc1" %>1 2 3 4 5