You are actually on the right track.
You should find that you can call the method described using something like this ...
ClientScript.RegisterStartupScript(Me.GetType, Guid.NewGuid().ToString(), "window.parent.CloseModalWindow('WindowName');", True)
source
share