By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,327 Members | 2,627 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,327 IT Pros & Developers. It's quick & easy.

window.open clears parent window

P: n/a
Hi:

I have a datagrid that builds a hyperling which uses javascript to
open a new window. The new window opens and displays fine, however,
the original window that has the grid, is now blank with only
"[object]" displayed in an otherwise empty window. To restore the
datagrid in that window, I have to use the browsers "back" button.

How can I stop the parent window from changing?

Thanks,
Ken
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
KenG wrote:
Hi:

I have a datagrid that builds a hyperling which uses javascript to
open a new window. The new window opens and displays fine, however,
the original window that has the grid, is now blank with only
"[object]" displayed in an otherwise empty window. To restore the
datagrid in that window, I have to use the browsers "back" button.

How can I stop the parent window from changing?


Ensure your <a> tag appears in rendered in one of these two forms:

1. <a href="new_page.aspx" target="someothername">
2. <a href="javascript:window.open("new_page.aspx");">

--
Ryan Walberg, B.Sc., MCSD, MCSD for .NET
ge*******@nospam.yahoo.com.nospam
Nov 18 '05 #2

P: n/a
This behavior can happen when using the <a> tag if the attributes are
not set correctly. Use the javascript function "window.open" instead.

Tommy,

ke********@juno.com (KenG) wrote in message news:<e3**************************@posting.google. com>...
Hi:

I have a datagrid that builds a hyperling which uses javascript to
open a new window. The new window opens and displays fine, however,
the original window that has the grid, is now blank with only
"[object]" displayed in an otherwise empty window. To restore the
datagrid in that window, I have to use the browsers "back" button.

How can I stop the parent window from changing?

Thanks,
Ken

Nov 18 '05 #3

P: n/a
Thanks for the reply, Ryan.

Here is the code in the datagrid item databound event. It does render
correctly when viewing it in the status bar of IE

HyperLink c=new HyperLink();
c=(HyperLink)e.Item.Cells[0].Controls[0];
c.NavigateUrl="javascript:window.open('EditOrder.a spx?param="+c.Text+"','_blank','width=530,height=6 45,toolbar=no,status=yes,scrollbars=yes,resizable= no');";
See anything wrong with this?

Thanks Again !!

Ryan Walberg <ge*******@nospam.yahoo.com.nospam> wrote in message news:<#J**************@TK2MSFTNGP10.phx.gbl>...
KenG wrote:
Hi:

I have a datagrid that builds a hyperling which uses javascript to
open a new window. The new window opens and displays fine, however,
the original window that has the grid, is now blank with only
"[object]" displayed in an otherwise empty window. To restore the
datagrid in that window, I have to use the browsers "back" button.

How can I stop the parent window from changing?


Ensure your <a> tag appears in rendered in one of these two forms:

1. <a href="new_page.aspx" target="someothername">
2. <a href="javascript:window.open("new_page.aspx");">

Nov 18 '05 #4

P: n/a
ke********@juno.com (KenG) wrote in message news:<e3**************************@posting.google. com>...
Thanks for the reply, Ryan.

Here is the code in the datagrid item databound event. It does render
correctly when viewing it in the status bar of IE

HyperLink c=new HyperLink();
c=(HyperLink)e.Item.Cells[0].Controls[0];
c.NavigateUrl="javascript:window.open('EditOrder.a spx?param="+c.Text+"','_blank','width=530,height=6 45,toolbar=no,status=yes,scrollbars=yes,resizable= no');";
See anything wrong with this?

Thanks Again !!

Try adding void() like this:

c.NavigateUrl="javascript:void(window.open('EditOr der.aspx?param="+c.Text+"','_blank','width=530,hei ght=645,toolbar=no,status=yes,scrollbars=yes,resiz able=no'));";
Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.