1: <%@ Page Language="C#" %>
2: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3: <script runat="server">
4: protected void button_Click( object sender, EventArgs e )
5: {
6: clickResult.Text = "Clicked";
7: }
8: </script>
9: <html xmlns="http://www.w3.org/1999/xhtml">
10: <head runat="server">
11: <title>Opener Page</title>
12: </head>
13: <body>
14: <form id="form" runat="server">
15: <div>
16: <asp:Label ID="clickResult" runat="server" Text="Test"></asp:Label>
17: <asp:Button ID="button" runat="server" OnClientClick="PrepareBlank()" PostBackUrl="~/NewPage.aspx"
18: Text="Run" OnClick="button_Click" />
19: <asp:Button ID="postButton" runat="server" Text="Post" />
20: </div>
21: </form>
22: <script type="text/javascript">
23: function PrepareBlank()
24: {
25: document.getElementById("form").target = "_blank";
26: }
27:
28: if(window.opener != null)
29: {
30: window.opener.document.getElementById("form").target = "";
31: }
32: </script>
33: </body>
34: </html>