Which is the best way to top ranking in any search engine On page and off page?

On page is all about tags, titles and keywords. Where as off page is all about providing best content and getting backlinks. So if you have effective words but not the content then visitor will left your site instant after visiting. So both appropriate and familiar word for driving visitor and useful and unique content to keep them connect with our site.

Both are very important in any search engine.

On-Page and Off-page both are important ways to rank your website on search engine.

I think both things are needed for its different purpose which brings traffic together.

In Off Page optimization you should emphasized on Article Writing,Article submission , Manual Search Engine submission,Manual Submission to niche directories,Building links from niche Blogs,Discussion Forum postings,Managing Link Exchanges,Social Bookmarking Submission,Social Blogging,Video Submission and optimization.while On Page Optimization is about Meta Tag Optimization,Content Writing,Content Optimization,Optimization for Flash and Frames,Image Optimization,Navigation Structure,HTML code optimization.

Both are very useful. Its like two tyres of a bike, without 1 the other one can't do anything. You have to keep both in priority.

Which is the best way to top ranking in any search engine On page and off page?

Both should be considered to get optimal result

You have to have both to get anywhere, if you don't Google see's it as not natural and they will penalize.

I think both are equally important to a website, if a site which has poor onpage optimization then it become tough to promote that particular website.

From SEO point of view, both are most important. Like you can say both side with a single coin.