Moving an inteface from excel to asp.net
I have an Excel spreadsheet that is used to collect data from a user, and is used to populate our database. I need to produce an asp.net page that can be used to collect this data instead.
I'm having some difficulty coming up with the best way to get this data, the current spreadsheet is used to allow the user to define a number of packages, and sub tasks to these packages, they can have an unlimited number of packages, so the spreadsheet looks a bit like this:
Package 1 | | | |
------------------------------------------------------------
Task 1 | 12/06/2010 | 15/09/2010 | 10 |
Task 2 | 18/07/2010 | 19/09/2010 | 12 |
Task 3 | 19/06/2010 | 15/09/2010 | 14 |
Package 1 | | | |
------------------------------------------------------------
Task 1 | 12/06/2010 | 15/09/2010 | 10 |
Task 2 | 18/07/2010 | 19/09/2010 | 12 |
Task 3 | 19/06/2010 | 15/09/2010 | 14 |
The spread sheet has space for 40 packages, and a macro to add more blank packages should they need more.
So I'm trying to come up with the best开发者_运维百科 interface for this data in an asp.net page, to allow the user to create any number of packages, and associate any number of tasks with these pacakges. This data needs to be saved to a database once they are done, so I need to be aware of what tasks link to what packages.
I've contemplated using gridviews, or list views to store this data on the page, but it all seems a bit unwieldy. I'd also considered just having some tables on the page and using some javascript to keep adding to these tables, but this will make submiting this data to the db quite difficult. I'd like to find a way to do this so its simple for the user, so any suggestions, or links to examples where it has been done would be much appreciated.
Check this out; I think it might be what you are looking for: http://mattberseth2.com/demo/Default.aspx?Name=Bulk+Inserting+Data+with+the+ListView+Control&Filter=All
Though, are you okay with the free form layout, or are you looking for a more specialized layout?
Stating the obvious, there are a lot of different possibilities. Off the top of my head you might consider:
- Create a web UserControl (ASCX) that encapsulates the interface for a single package & set of associated tasks. I imaging you would use something like a GridView (or other databound control) to record the tasks. It might also contain the logic for saving just that package/tasks.
- Perhaps use AJAX to improve perceived response and usability on the page. If you use the ASP.NET AJAX Control Toolkit you can wrap each ASCX in an update panel so only that package is saved. Give each ASCX it's own save button.
- Put a "New package" type button/link on the page that dynamically loads a new ASCX on the page (again, AJAX can assist). Or, when the last new package control is filled in and saved, it automatically loads adds a new ASCX to the page.
精彩评论