1

I can open another window to display some stuff, but then I cannot use the buttons on the original page anymore. Why is this and how to fix it? This is my code:

<asp:Button ID="Button_ViewSimpleRequest" Text="Simple Request" runat="server" OnClientClick="window.document.forms[0].target='_blank'"  PostBackUrl="~/xyz.aspx" />
<asp:Button ID="Button_Self" Text="Self" runat="server" OnClientClick="window.document.forms[0].target='_self'" />

After clicking the first button, the second button also redirects to xyz.aspx. How do I make the second button behave like a normal button on the original page?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Roland
  • 4,619
  • 7
  • 49
  • 81
  • I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders Mar 10 '14 at 15:57
  • 2
    This guy has a very good aproach: http://stackoverflow.com/questions/7366243/how-to-launch-another-aspx-web-page-upon-button-click – Chrisi Mar 10 '14 at 15:57
  • I tried: `` which is less code, simpler, and seems to work. Thanks. – Roland Mar 10 '14 at 16:27

1 Answers1

1

I tried: <asp:Button ID="Button_ViewSimpleRequest" Text="Simple Request" runat="server" OnClientClick="window.open('xyz.aspx', 'name')" /> which is simple, and seems to work.

I found my solution by studying How to launch another aspx web page upon button click.

Community
  • 1
  • 1
Roland
  • 4,619
  • 7
  • 49
  • 81