BtnAddRec.Attributes.Add("onclick", "javascript:return confirm('Message Here')")

I'm using this code in the btnAddRec click event, but it's not giving me the message. Is this correct?