One dirty trick could be to pass a parameter and compare with something fixed. Outside callers wouldn't know the value.
Something like this (VB):
function myAction(byval key as string, .....) as actionresult
if key <> "<something only i know>" then return nothing 'this could the very first line
' this something only you know can be stored in Web.config and read using AppSettings
' so you don't need to hardcode anything in the code
end function
Easiest possible solution.
If you don't want to use a hardcoded key in the code or in Web.config, you can also generate a random number when session starts and cache that random number. Pass that random number in the key and in the first line, instead of checking for a hardcoded value, read from the cache (could be httpSession ) in myAction and compare. This way there is no danger of key leak to public. just so someone doesn't run a counter to call the function, you can prefix the generated random number with some text such as "XTT-".