High surface area organic materials featuring both micro- and mesopores were synthesized under ionothermal conditions via the formation of polyaryltriazine networks. While the polytrimerization of nitriles in zinc chloride at 400 degrees C produces microporous polymers, higher reaction temperatures induce the formation of additional spherical mesopores with a narrow dispersity. The nitrogen-rich carbonaceous polymer materials thus obtained present surface areas and porosities up to 3300 m(2) g(-1) and 2.4 cm(3) g(-1), respectively. The key point of this synthesis relies on the occurrence of several high temperature polymerization reactions, where irreversible carbonization reactions coupled with the reversible trimerization of nitriles allow the reorganization of the dynamic triazine network. The ZnCl2 molten salt fulfills the requirement of a high temperature solvent, but is also required as catalyst. Thus, this dynamic polymerization system provides not only highly micro- and mesoporous materials, but also allows controlling the pore structure in amorphous organic materials.