TECHNOLOGY FOCUS - POLYMERS - Preferred Polymer: The nitrogen-containing polymer comprises repeating units of formula (I).R1 = H or 1-4C alkyl;Z = a nitrogen-containing heterocyclic group;L = a single bond or a divalent linking group;A = a repeating unit derived from an ethylenically-unsaturated compound;x = 5-100 mol%; andy = 0-95 mol%.    TECHNOLOGY FOCUS - ORGANIC CHEMISTRY - Preferred Electrophilic Reagent: The electrophilic reagent is of formula (II).X = a releasing group;Y = a single bond or an s-valent linking group;s = 2-4; andZb = a single bond or a divalent linking group.Preferred Electrolyte: The electrolyte additionally contains compound(s) of formula (III) and/or (IV).R2, R3 = alkyl, alkenyl or aryl;R4 = cyano, alkoxycarbonyl, acyloxy, carbonamido, phospho, phosphoric acid, phosphino, phosphoryl, carbamoyl, urethane, urea, carbonate, sulfonamido, sulfamoyl, sulfoxide, sulfone, sulfonyl, nitro, alkoxy, aryloxy or hydroxy;E = a single bond, alkylene, alkenylene or arylene; anda, b, c = 0 or 1.R5 = heterocyclic, alkyl, alkenyl or aryl; andD = -O-, -OC(O)- or -OC(O)O-.The electrolyte is preferably obtained by allowing the electrophilic reagent to react with the nitrogen-containing polymer in a solvent containing a dissolved salt.Preferred Electrochemical Cell: The semiconductor layer contains a dye-sensitized particulate semiconductor. Preferred Definitions:    Z = pyridine or imidazole;    X = halogen, alkylcarbonyloxy, arylcarbonyloxy, aralkylsulfonyloxy or arylsulfonyloxy; and    Zb = a single bond, -CO-, -COO-, -SO-, -SO2- or phenylene.    EXAMPLE - An acetonitrile solution containing 0.5 mol/l of 1-methyl-3-hexylimidazolium iodide (electrolyte salt) and 0.05 mol/l iodine was prepared. Nitrogen-containing polymer (V) was added in amount 10 wt.% of the solution, followed by 0.1 equivalents of electrophilic reagent (VI).    A dye-sensitized TiO2 electrode and a Pt-deposited glass substrate (counter electrode) were brought into contact. The polymer solution was penetrated into the sandwich by making use of osmotic pressure. The impregnated electrode was heated at 80 degreesC for 30 minutes to induce crosslinking. The resulting cell had the following characteristics: short circuit current density (JSC) = 6.12 mA/cm2; open circuit voltage (VOC) = 0.65 V; fill factor (FF) = 0.43; conversion efficiency (eta) = 2.01%; JSC after 360 hours = 3 mA/cm2; and JSC reduction = 51%.    For comparison, a similar cell was prepared using an electrolyte comprising 0.05 mol/l iodine, 0.5 mol/l LiI and a 90/10 (by volume) mixture of acetonitrile and 3-methyl-2-oxazolidinone. This cell had JSC = 9.9 mA/cm2; VOC = 0.6 V; FF = 0.43; eta = 2.97%; JSC after 360 hours = 0.21 mA/cm2; and JSC reduction = 98%.