// PmXmlFiles is an Arraylist containing 3 strings (created before this line) string cPmXmlFiles; // Serialize the Arraylist using JsonConvert() cPmXmlFiles = JsonConvert.SerializeObject(PmXmlFiles); // I check in the debugger and the value cPmXmlFiles appears to be correct // set the value of the above string to the hidden Input NewStorage.Value = cPmXmlFiles; // I also check in the debugger that the Value of the NewStorage appears to be a string. // The line below is supposed to store the Value of NewStorage to the localStorage ScriptManager.RegisterStartupScript(this, GetType(), "cost_center_key_string", "localStorage.setItem('pm_xml_files', $('#NewStorage').val());", true); // But somehow it does not workWhat am I missing?