Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

open a new window when a Button is clicked.

Last post 03-28-2008 4:20 PM by tarz. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 03-28-2008 4:20 PM

    • tarz
    • Not Ranked
    • Joined on 03-28-2008
    • Canada
    • New Member
    • Points 5

    open a new window when a Button is clicked.

    Hi,

    I want to add a functionality to the button onclick. When I click on the button, I want to open a new aspx page in a new window and pass a parameter in the querystring.

    Firstly, I tried using response.redirect

    Response.Write("<script>window.open(a.aspx?GTIN=" +gtin.Text+ "');</script>");

    It works, it opens a new window, but something happens to my previous window after the second window loads. The css becomes not used. (at the begin the css loads, but after I click the button, it seems like css is not been used in my previous page).. Any ideas why the css file is not been active when I click on the button.

    Than, I tried,  to add an attribute to the button:

    string command = "window.open(a.aspx?GTIN=" + gtin.Text.Trim() + "');";

    this.bt_image.Attributes.Add("onclick", command);

    and it loads only when I click the second time on the button. First time I click the button, nothing happens.. second time it opens.. Why is that?

    Please let me know what am I missing?

    Thank you

     

     

     

    • Post Points: 5
Page 1 of 1 (1 items)