The use of liquid electrolytes in dye-sensitized solar cells (DSSCs) is a significant obstacle for the commercialization of DSSCs. Even the idea of evaporation or leakage of electrolyte profoundly shakes the trust in DSSCs, which are expected to last for a long time when used outdoors. At work, it aims to prepare stable and more economical DSSCs with the use of quasi-solid electrolytes and poly(aniline) (PANI) counter electrode. So, two types of quasi-solid electrolytes, anionic (AGE) and cationic gel electrolytes (CGE) were obtained after synthesized anionic poly(4-vinyl-benzenesulfonate-co-acrylic acid), and cationic poly(2-methacryloyloxyethyl trimethylammonium chloride-co- acrylic acid) hydrogel polymers engaged the liquid electrolyte. Thermogravimetric analysis (TGA), Fourier-transform infrared spectroscopy (FTIR), frequency-dependent dielectric properties, and conductivity properties of the prepared polymers were also performed. TGA showed that both polymers were resistant to temperature-dependent degradation up to 250 degrees C. The prepared gels were applied onto the TiO2 photoanode, which was sensitized by N719 dye and six DSSCs were prepared at different configurations. Current-voltage (I-V) characteristics and impedance analysis of the DSSCs were performed under 1000 W/m(2) light intensity. While 6.6% and 6.3% power conversion efficiencies were obtained for the standard liquid electrolyte/Pt and liquid electrolyte/PANI cells respectively, they were in the range of 4.2-5% for DSSCs prepared with quasi-solid electrolyte/Pt-PANI counter electrodes.