Help! Popup window clears current frame

S

Sunit Joshi

Hello All
I have an aspx with a datagrid having hyperlink colns. I open a popup
window like this
<asp:HyperLinkColumn DataTextFormatString="Click.."
DataNavigateUrlField="ID" DataTextField="ID"
HeaderText="Desc" DataNavigateUrlFormatString=
"javascript:varwin=window.open('getDetails.aspx?ID={0}',null,'menubar=no,width=400,height=80');"
/>

The window opens fine, but when I close it the current frame window
(containing the datagrid) becomes blank with a [object] line in it
only.
If I press back now on this window then I get back to the datagrid
page.

The page setup is like this
Banner framset
-------------------
contents frameset| datagrid frameset
<frameset rows="103,86%">
<frame name="banner" src="banner.htm" scrolling="no" noresize>
<frameset cols="155,81%">
<frame name="contents" src="images/contents.html" noresize>
<frame name="main" src="main.htm">
</frameset>
<noframes>
<p id="p1">
This HTML frameset displays multiple Web pages. To view this frameset,
use a
Web browser that supports HTML 4.0 and later.
</p>
</noframes>
</frameset>

I even tried this on the popup window
<script language="javascript">
function CloseWin()
{
self.close();
top.main.history.back();
}
</script>

But it doesn't work. Any pointers are appreciated...

thanks
Sunit
(e-mail address removed)
 
S

S. Justin Gengo

Sunit,

Your javascript is opening the window, but you are also doing a postback to
the old window when asp.net post's back the link. Instead of using the
actual link you should code the column to use a "onclick" javascript that
ends with "return false;" so the link won't actually be clicked. I would
recommend using a template column with a regular html link in it then give
it the "onclick" attribute and your javascript.
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top