I have embed existing legacy VF page inside a lightning component. In this page I am calling a remote method onload event for window. Here we are getting following error:
"Visualforce Remoting: Javascript proxies were not generated for controller abc: may not use public remoted methods inside an iframe."
If I declare all remote actions global this error resolved. But I don't want to go with this approach as solution because, to make all remote actions global I need to make classes as global also.
Is there any other way/approach to resolve this issue?
global
is the appropriate solution. I've presented at least 3 other alternatives, but they may not be suitable for your code (can't tell without seeing your code). Sometimes something has to be global, because it's the only way. One thing that you should remember as a developer is that there are almost always reasons to break a "best practice"; an exception to the rule.