To overcome the problem of the PrefixId use:
in some cases produce a different result. In the next version I will fix PrefixId;
Your code looks correct...adding alert....doesn't overcome any TimeOut problem since it just increases the computation time. Maybe, since, the server get several requests from different rows, it is not able to server them: introducing the alert just cause
WebDev is not an actual Internet server...it is just to test programs in visual studio...so it get confused by several requests. Test your code on IIS, you can install it also on your dev machine. Just go into programs installations, and select to install
pieces of windows.
Let me know if IIS solve the problem. Otherwise you can send a whole project so I can debug it.