You can not call asp.net function from .asp page.
Try using AJAX.
I ran into a similar problem a few years back and what I did was, from ASP page I passed variables to .ASPX page and after executing script at .ASPX page passed variable again to same ASP page and used if-than-else to execute the remaining ASP script.
Bookmarks