Quasi-solid-state dye-sensitized solar cells have drawn the attention of scientists and technologists as a potential candidate to supplement future energy needs. The conduction of iodide ions in quasi-solid-state polymer electrolytes and the performance of dye sensitized solar cells containing such electrolytes can be enhanced by incorporating iodides having appropriate cations. Gel-type electrolytes, based on PAN host polymers and mixture of salts tetrahexylammonium iodide (Hex(4)N(+)I(-)) and MgI(2), were prepared by incorporating ethylene carbonate and propylene carbonate as plasticizers. The salt composition in the binary mixture was varied in order to optimize the performance of solar cells. The electrolyte containing 120% Hex(4)N(+)I(-) with respect to weight of PAN and without MgI(2) showed the highest conductivity out of the compositions studied, 2.5 × 10(-3) S cm(-1) at 25 °C, and a glass transition at -102.4 °C. However, the electrolyte containing 100% Hex(4)N(+)I(-) and 20% MgI(2) showed the best solar cell performance highlighting the influence of the cation on the performance of the cell. The predominantly ionic behaviour of the electrolytes was established from the dc polarization data and all the electrolytes exhibit iodide ion transport. Seven different solar cells were fabricated employing different electrolyte compositions. The best cell using the electrolyte with 100% Hex(4)N(+)I(-) and 20% MgI(2) with respect to PAN weight showed 3.5% energy conversion efficiency and 8.6 mA cm(-2) short circuit current density.