Here we report a facile and effective strategy for the preparation of ordered mesoporous carbon materials with a high-nitrogen-content (8.1 at%) coating layer through a polymer-ionic liquid assembly strategy. The prepared N-doped mesoporous carbon materials demonstrated enhanced CO2 adsorption capacity (2.29 mmol g-1) compared with non-doped carbon (1.84 mmol g-1).