This study addresses polymer-surfactant interactions at solid-liquid interfaces and how these can be manipulated by modulating the association between ionic surfactant and oppositely charged polymer, with a particular focus on electrostatic interactions. For this purpose, the interaction of a series of cationic copolymers of vinylpyrrolidone and quaternized vinylimidazol with sodium dodecyl sulfate (SDS) at the silica-aqueous interface was followed by in situ ellipsometry. To reveal the nature of the interaction, we performed measurements for different copolyion charge densities, in the absence and presence of added salt. The path-dependence of the interaction was studied by comparing the adsorption under two different conditions, adsorption from premixed solutions and sequential addition of surfactant to the polymer solution, but the same end state. The reversibility of the adsorption process was studied by following the effect of dilution on the adsorbed layer. All copolyions adsorbed to both silica and hydrophobized silica, revealing the importance of both hydrophobic and electrostatic attractive interactions. On both types of surface, an increase in adsorbed amount was found on lowering the fraction of charged units. An increased ionic strength gave an increased adsorbed amount in all cases, but especially on hydrophobic surfaces. The adsorbed amount on silica from mixtures of the copolyions with SDS peaked at an SDS concentration corresponding closely to the concentration of cationic charges of the different polyions. Around the region of charge equivalence, there was also a phase separation in the bulk. At higher concentrations of SDS, a redissolution in the bulk, and a decrease in adsorbed amount, occurred as a result of excess SDS binding to the complexes. For the most highly charged polyions, we observed a decrease in adsorbed amount, and a shift in the adsorption maxima to lower SDS concentrations, with increasing ionic strength.