ASP.Net has a built in timeout that will cause it to kill a connection exceeding the configured limits.
The default is 110 seconds.
<system.web>
<httpRuntime executionTimeout="110">
</system.web>
However, this is disabled when compiled in DEBUG mode.
<!-- Execution Timeout Will Not Be Enforced -->
<compilation debug="true" />
If you need to set an execution timeout for a specific handler, then you can always create a location specifically for that handler, and set the timeout there.
<location path="MyHandler.ashx">
<system.web>
<!-- Set execution timeout to 10 minutes -->
<httpRuntime executionTimeout="600"/>
</system.web>
</location>