DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: need help with javascript

  1. #1
    Join Date
    Jul 2007
    Posts
    4

    need help with javascript

    I am using ASP.NET 2.0, C# and javascript to open a new browser window and encounter the following problem:

    On Page1.aspx I have a button with the following click event:

    Response.Write("<script>window.open('Page2.aspx','_new');</script>");

    This works as expected.

    On Page2.aspx I have again a button with the following click event:

    Response.Write("<script>window.open('Page3.aspx','_new');</script>");

    This is my problem; Page3 does not open in a new window, instead it opens in the same window (Page2). I want a new window and when a user finishes with Page3, he can close the window and return to Page2.

    Thank you in advance for your help.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    When you open Page2, your JavaScript creates a window named "_new". Your Page2 JavaScript then reuses that window to display Page3. Either change your scripts to specify a unique name for each popup window, or use the special value "_blank", which always opens a new window.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Jul 2007
    Posts
    4
    Thank you Phil for the quick reply and I really appreciate your help. Solves my problem -- Great Forum and community; especially for a newbie like me.

Similar Threads

  1. Replies: 0
    Last Post: 03-10-2007, 11:24 PM
  2. Replies: 5
    Last Post: 05-06-2006, 10:22 PM
  3. problems with javascript
    By Michael in forum ASP.NET
    Replies: 10
    Last Post: 11-08-2005, 01:19 PM
  4. Help with Javascript in forms
    By Keith Sarver in forum Web
    Replies: 0
    Last Post: 12-14-2002, 03:18 PM
  5. Sample Sites.
    By Murray Foxcroft in forum Web
    Replies: 5
    Last Post: 11-02-2000, 03:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center