In 2004, Marsden co-starred with Rachel McAdams, Ryan Gosling, James Garner, and Gena Rowlands in the romantic drama The Notebook as Lon Hammond, Jr. , the second man Allie Hamilton (McAdams) falls in love with. In 2007, Marsden played Corny Collins in the film adaptation of the Broadway musical Hairspray, based on the 1988 John Waters film of the same name. In the film, he sang two songs, "The Nicest Kids In Town" and "(It's) Hairspray. " Both Hairspray and its soundtrack were critically acclaimed, the latter of which has since sold over 1,200,000 copies to date in the United States and was certified Platinum by the RIAA. His next role was with Amy Adams in the Disney hybrid animated/live action film Enchanted, playing Prince Edward. He sang one song as a duet with Adams at the beginning of the film and a duet with Idina Menzel that was cut from the film. Enchanted was well received critically and proved to be a commercial success, earning more than $340 million worldwide at the box office.