Is it possible to set OnCommand property of a button in run time? I tried

MyBtn.Attributes.Add("OnCommand", "MySub")

but it does not work.

Thanks.