WARNING
In some supplies with connections like the one shown the two screws are the terminal screws. In other cases these may just hold a cover in place. If those are terminal screws then you will have AC mains on the screws when in use. (I have seen this done).
Provided it is in fact an isolated supply (see PK's comment) it should work OK.
A supply for LEDs may have some noise but if it is a switching converter this is liable to not bother a solenoid. If it is an iron core conventional transformer - possible but unlikely due to relative costs nowadays - it can have 100 HZ ripple (2 x 50 Hz UK mains frequency) but for LEDs this would need to be low enough to not grossly affect a solenoid.
Quality of such low cost supplies CAN be such that it blows up along the way and worst case it may apply mains to the output if it does blow up - even if it is an "isolated" supply. Be prepared to have the solenoid destroyed and mount it so it does not kill you or burn the house down if it dies.
DO NOT be overly put off by the above safety advice - it applies to many low cost mains powered products - it's just that people don't give enough consideration to such things. In many cases even poorly made equipment lasts indefinitely. But some definitely doesn't.
I would usually 'pop the top' on such supplies to see how they have been built. This can be distressingly easy to do in some cases) A glued back together wellish built supply may be a better bet than a nicely sealed death trap.
INFORMAL test. - "Don't try this at home" (you know what I mean).
Measure input to output DC resistance on a high Ohms range. Resistance should be VERY high if not essentially infinite. If not, ask further. Pros and cons apply.
Next: Power up on mains with output disconnected and measure using AC 250V or higher meter range between output (either lead) and house wiring ground or house wiring neutral. If there are capacitors between output and input (for noise suppression purposes) Vout will be at ABOUT Vmains/2. If so you will be able to get a tingle from the output relative to ground if operated isolated. This is not a fault per se - it is based on regulatory requirements (which may not bother your manufacturer) and even top quality supplies MAY do this. Grounding one output lead will stop this happening. A floating output that has Mains_AC/2 on it via capacitors will happily destroy some equipment - ask me how I know :-(.
Then, if there is very high or infinite resistance and no caps evident, "megger" it with an insulation tester or similar if available - see below.
If a tester is not available, using suitable connections and due care, connect mains AC from one input lead to one output lead !!! Usually done with an extension cord and crocodile clip leads powered from a minor distance away.
Using tester or mains, apply voltage.
If it goes bang, it may have done so anyway in far more dangerous circumstances.
If it survives this test it is NOT a guarantee that it is safe - just an indication that it's not utterly terrible. Some ARE utterly terrible and weeding them out is worth GBP2.29 in experience gained.