The way you have added attribute is correct. But you are expecting it to be a sever side method, which is not the case. The attribute
has been added at the client side; which means
It would look something like this:
//show modal dialog here...