The issue is with this line
data:{deleterow: true, ID: rowid},
should be
data:{‘deleterow’: true, ‘ID’: rowid},
fiddled around a bit more. Peter I see your point with the session variables. They were only for testing anyway. I would never expose session variables so readily.
Phill