NOVELTY - Preparation of polyionic liquid-based microporous quasi-solid electrolyte involves reacting imidazole having unsaturated double bonds on side chains with iodoalkane, cooling, washing excess iodoalkane and vacuum drying; dissolving obtained ionic liquid in ethanol, free-radical polymerizing in the presence of azobisisobutyronitrile under nitrogen protection, and vacuum drying; dissolving obtained polyionic liquid, polyvinylidene fluoride and propanetriol in N,N-dimethylformamide, vacuum drying, and soaking in ethanol; and soaking obtained microporous polymer membrane in electrolyte.    USE - Method for preparing polyionic liquid-based microporous quasi-solid electrolyte used for dye-sensitized solar cells (claimed).    ADVANTAGE - When applied to dye-sensitized solar cell, the electrolyte not only solves the problem that it is difficult to package cell, but also improves charge transfer capacity in quasi-solid electrolyte system, thus improving performance of cell.    DETAILED DESCRIPTION - Preparation of polyionic liquid-based microporous quasi-solid electrolyte involves:    (A) mixing imidazole having unsaturated double bonds on side chains with iodoalkane at ratio of 1:1-1.5, putting the mixture in reaction kettle having PTFE lining, sealing the kettle and heating, reacting at 80-120 degrees C for 4-12 hours, cooling the kettle to room temperature, taking out the product, and washing excess iodoalkane and removing remaining ether solvent by vacuum drying at 80 degrees C for 24 hours to obtain ionic liquid comprising iodine and imidazole;    (B) dissolving ionic liquid in ethanol at 0.33-0.5 g/ml, free-radical polymerizing in the presence of azobisisobutyronitrile (2-10 wt.%) at 60-80 degrees C 10-30 hours under nitrogen protection, and vacuum drying at 80 degrees C for 24 hours to remove ethanol and obtain polyionic liquid;    (C) dissolving polyionic liquid (1 g), polyvinylidene fluoride (0.1-9 g) and propanetriol (0.15-14 g) in N,N-dimethylformamide (20-200 g), stirring at 60-80 degrees C to obtain homogenous solution, pouring the solution to a clean glass and vacuum drying at 80-100 degrees C for 12-24 hours, and soaking in ethanol for 12-24 hours to obtain microporous polymer membrane; and    (D) soaking microporous polymer membrane in electrolyte containing (mol/L) inorganic iodine salt (0.1-0.5) and iodine (0.05-0.2) for 12-24 hours.