Different configurations of CdS nanoparticles (NPs) are linked to Au electrodes by electropolymerization of thioaniline-functionalized CdS NPs onto thioaniline-functionalized Au-electrodes. In one configuration, thioaniline-functionalized CdS NPs are electropolymerized in the presence of thioanline-modified Au NPs to yield an oligoaniline-crosslinked CdS/Au NPs array. The NP-functionalized electrode generates a photocurrent with a quantum yield that corresponds to ca. 9%. The photocurrent intensities are controlled by the potential applied on the electrode, and the redox-state of the oligoaniline bridge. In the oxidized quinoide state of the oligoaniline units, the bridges act as electron acceptors that trap the conduction-band electrons that are transported to the electrode and lead to high quantum yield photocurrents. The reduced π-donor oligoaniline bridges act as π-donor sites that associate N,N′-dimethyl-4,4′-bipyridinium, MV2+, by donor/acceptor interactions, Ka = 5270 M−1. The associated MV2+ acts as an effective trap of the conduction-band electrons, and in the presence of triethanolamine (TEOA) as an electron donor, high photocurrent values are measured (ca. 12% quantum yield). The electropolymerization of thioaniline-functionalized Au NPs and thioaniline-modified CdS NPs in the presence of MV2+ yields a MV2+-imprinted NP array. The imprinted array exhibits enhanced affinities toward the association of MV2+ to the oligoaniline π-donor sites, Ka = 2.29 × 104 M−1. This results in the effective trapping of the conduction-band electrons and an enhanced quantum yield of the photocurrent, ca. 34%. The sacrificial electron donor, TEOA, was substituted with the reversible donor I3−. A solar cell consisting of the imprinted CdS/Au NPs array, with MV2+ and I3−, was constructed. The cell generated a photocurrent with a quantum yield of 4.7%.