What's the difference between どうされましたか and どうなさいましたか?
Both される and なさる are 尊敬語 forms of する. The only difference is that なさる is considered to be more honorific than される.
Also される can be mistaken for the passive form:
何をされましたか。 : What did other people do to you?
何をされましたか。 : What did you do?
Both are corrects, and the only way to make the difference is through the context. But when the context is not clear and you want to use the honorific form and not the passive form, you should use なさる and not される (or rephrase your sentence).