Upvote:2
Napoleon's career as a national hero started after his military victories during the "revolutionary wars" in France (Toulon) and Italy.
His next adventure was expedition to Egypt which ended with a humiliating defeat, but somehow this was not clear to most in France, and they made him a dictator with strong popular support. The later spectacular victories of the French army very much increased his popularity. He was able to ride on the wave of patriotism.
I understand this seems weird to some people, but one has probably to take into account almost a century of previous continuous British-French wars. Probably it seemed to many people that he is able to finally win this competition.