What does the server show? Does the above code get executed? If you can't see exactly, I suggest adding some logging statements to show. At least enough to see whether the code is being reached.
And what does the code behind the button do? If it is opening another window or tab, I don't think it will work.
I won't have a chance today, but, I can try and have a play at work in the next few days. There's plenty of servers I can try something like this on. It would help to have all the code involved. Any chance? If so, send me PM with a download link, or I can send you an email address to send it to.
|