I want to have a button/link in a datagrid do two separate things when clicked on: 1) set a session variable, and 2) open a URL with some data in the querystring.<BR><BR>Here are the details:<BR><BR>I have a page that displays a list of tests a user is scheduled to take. (Scheduling comes from an SQL table.)<BR><BR>At the moment, the tests show up in a datagrid, and the user clicks on a hyperlinkcolumn which opens the URL for that particular test.<BR><BR>However, I only want that user to be able to open that hyperlink when coming from the main test menu page. If the user copies the URL and goes to the page on their own later, I want them to see nothing.<BR><BR>I have thought of a few options using Session variables. My first attempt involved setting a "UserAuthorized" session variable when the main page is opened. When the page containing the test is displayed, it would check to make sure that Session("UserAuthorized") = True. This verified that the browser window they are looking at was opened from the main window which displayed their tests to be taken. However, once in the test window they could easily change the URL to another test without leaving the session, so they would still be considered "authorized".<BR><BR>I think my best option now is to set a session variable to contain the name of the test they have clicked on. That way I can show them the list of tests they are to take, they click on one, the session variable records that name, the test window is opened, and we&#039;re good to go. If they change to another URL, the session variable will not match the test name, and they will see nothing. (Even if they are supposed to take the test, they should only be accessing it by the link I provide.)<BR><BR>How can I have the user click a single button (either a buttoncolumn or a hyperlinkcolumn in the datagrid) and have it 1) trigger code to set the session variable to match the ID from that row of the datagrid, and 2) have it launch the page with the ID in the querystring?<BR><BR>Or are there other (easier) ways of doing this?<BR><BR>Thanks.