Here is the same thing for ASP:
Server.ScriptTimeout = 180
Just place this code anywhere on the page to increase the timeout. If you place it inside of the loop you will be updating the time allowed for each record in the loop. If you can spot the loop in the code you can place it there, otherwise it would just go at the top of the page. If you post back with a copy of your page in a zip archive I can point out where this would need to go in the page.