I am not sure about how are you calling the OpenWindow function. If you are calling using OnClientClick of ASP.NET button, then you need to cancel the postback in order to show the window as shown below.
|<asp:Button ID="Button2" runat="server" Text="Button" OnClientClick="OpenWindow(); return false;" />
Another option is setting the OpenerElementID
property to ButtonID for opening the window on clicking the button.