Need "How To" Help with ASP.NET Dynamic List View
Posted on 2014-09-29
I'm struggling to come up with a "Best way" to solve a problem, and need your expert guidance. I have an ASP.NET page that displays summarized data about employee work shifts. This data is displayed in a list view. Each line of the list view is summarized from one or more individual records in my SQL Server database. I want to put a link on each line of the list view that the user can click. Clicking this link would show a floating div with another list view that would show the detailed records from the database that rolled up to that summary line. Inside this DIV would be a button to close (hide) the detailed view.
I already have a stored procedure written that would get the data for this DIV pop-up, which requires three parameters. My desired flow is:
1. Summary ListView is populated on Page Load.
2. Each Row of ListView has a Details LinkButton. The Stored Procedure needs three parameters that are unique for each row of the ListView: Employee ID, Start DateTime, End DateTime.
3. When the user Clicks The Detail LinkButton, it fires a procedure that collects the three needed parameters from the row, passes them to the stored procedure, and uses the returned dataset to bind to the Details list view that is held in a floating Pop-Up style DIV.
4. When the user is done reviewing the detail data, they click the Close button in the pop-up div, and the div is hidden again.
5. I want all of this to be Asynch (working inside an update panel) so I don't want the link to fire out to a whole new page with query string parameters. I want it to be something where they click the detail button, the detail div pops up with the data in it, they close it, and move on down the list clicking the details button as desired to view the details for each employee, all without the page constantly being reloaded.
I know how to make it all work, except the part of how to structure the initial summary ListView LinkButton to initiate the procedure that would call the stored procedure, bind the result to the detail list view, and show the detail pop-up DIV.