Question about variable persistance
Hello, I am a WinForms Developer migrating to Web Development. I am specifically migrating to ASP.NET Web Forms at the moment. My only experience with Web Development at this point is from a couple of books.
Here is a problem that was never an issue for me in WinForms. Hopefully, someone can point me in the right direction.
Let's say you have a search screen for employees. You are not allowed to display anything that could be used as a unique identifier for each record in the grid on the screen. You are only allowed to diplay the name of the employees on the screen. When a user selects a record in the grid, you take the Employee ID of the selected record and search the datase.
The screen can be filtered. The user loads all 25 records for the employees in a certain Department. 17 of those 25 employees in that Department have the name of John Henry Smith. The user filters the list down to 3 records by searching for the last name of Johnson within the Department. You store those 3 records in a session variable for later use. The user then hits the Internet Explorer back button, pulling the previous screen out of the cache and simply dumping it onto the screen with all of the records displayed. The user then selects one of the employees named John Henry Smith, who happens to be the 20th record in the grid. You can't rely on Session variables, because that list only contains 3 records, none of which are the record you're looking for. You can't pull the Employee ID off the screen because you are not allowed to cheat and display it on the screen. Where do you get the Employee ID to search the database with?
Last edited by SillyPants; July 29th, 2011 at 09:47 PM..
|