Maybe you've got some confusion about that =)
public sub ex()
...
end sub
, - is a server side code, while
jQuery
or
Ajax
is a client side frameworks...
If you want to run some server side logic from a client side, i strongly advise to you look into
SignalR
framework.