I am developing a website which retrieves data from a database but im new to web developing.
I use gridviews,dropdown lists and others, to show data but there is a page where the website user will set how many specific dropdown lists will need to do his work.
To be more specific the user will choose products and each products’ quantity but i don’t know how many products the user will need. If the user wants to enter x number of products, i want to create x number of drowdown lists(in different rows), so that he could select x number of products and their quantities.
e.g.
User A wants to select 2 tomatoes,3 potatoes and 5 watermelons.
He will type 3(for number of products) in a textbox and then 3 rows will appear with 2 dropdown lists each, and user will select
tomatoes 2
potatoes 3
watermelons 5
add new line->>>this is another thing i want to create
Any ideas??
In the codebehind, specifically during the
Page_Loadevent, you’ll want to determine how many dropdowns are needed, and then create them on the fly. There are quite a few examples that would result from a google search, but a quick example would look like: