You'll need to use AJAX to find a solution to this small problem.
Alternatively here's the link to a Yes/No MsgBox class. It is written in C# and quite excellent.
http://www.c-sharpcorner.com/UploadFile/mahesh/WebMsgBox09082006110929AM/WebMsgBox.aspx