Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Popup Windows in DataGrid

18 views
Skip to first unread message

crjunk

unread,
Feb 25, 2003, 4:04:07 PM2/25/03
to
In my datagrid I have a HyperLinkColumn. Whenever a user clicks on a
Hyperlink in the DataGrid, the record is displayed in a popup window.

This seems to be working except for one thing. An extra popup window
is being displayed with the following text on it: [object]. This is
the url that is displayed in this extra popup window that I'm trying
to get rid of: javascript:window.open('viewrec.aspx?recordnum=50685','','width=640;height=480;%20scrollbars=1;%20resizable=1');

Here is the code I have written for the HyperLinkColumn in my
DataGrid. Can someone tell me what I'm doing wrong?

Thanks in advance!

<asp:HyperLinkColumn DataNavigateUrlField="recordnum"
DataNavigateUrlFormatString="javascript:window.open('viewrec.aspx?recordnum={0}','','width=640;height=480;
scrollbars=1; resizable=1');" Target="_blank"
DataTextField="proj_name" HeaderText="Project Name">

<HeaderStyle Font-Bold="True" VerticalAlign="Top"></HeaderStyle>

</asp:HyperLinkColumn>

Datagrid Girl [MVP]

unread,
Feb 25, 2003, 6:31:07 PM2/25/03
to
Try taking out the Target="_blank" Since you're already specifying the
javascript:window.open, you shouldn't also need to set the target.

Datagrid Girl
http://www.datagridgirl.com

"crjunk" <crj...@earthlink.net> wrote in message
news:e45e90aa.03022...@posting.google.com...

crjunk

unread,
Feb 26, 2003, 9:10:05 AM2/26/03
to
Thanks for you help Datagrid Girl. I tried taking out the
Target="_blank" but I'm still experiencing problems. Instead of the
[object] error appearing in a new popup window, it now appears in the
window that contains my datagrid. Any other suggestions or
recommendations?

BTW I just wanted to give you some praise. The instructor I had for an
ASP.NET class highly recommended your web site.

"Datagrid Girl [MVP]" <datagr...@operamail.com> wrote in message news:<eniT#WS3CH...@TK2MSFTNGP10.phx.gbl>...

crjunk

unread,
Feb 26, 2003, 11:07:55 AM2/26/03
to
I finally got this to work. I had to do some surfing in the
javascript newsgroup.

Here is an answer that I found in an old message:

"means for the browser to evaluate expression and replace the current
page with its value, unless the value happens to be void. The value
returned by window.open() is an Object, whose string representation
is what you're seeing.

To get the side-effect of this feature which you want, without getting
its intended behavior, which you don't want, make sure the expression
evaluates to void:"


Here is what I had to do to correct this problem that I was
experiencing.

<asp:HyperLinkColumn DataNavigateUrlField="recordnum"
DataNavigateUrlFormatString="javascript:void
window.open('viewrec.aspx?recordnum={0}',null,'width=640;height=480;scrollbars=1;
resizable=1');" DataTextField="proj_name" HeaderText="Project Name">


<HeaderStyle Font-Bold="True" VerticalAlign="Top"></HeaderStyle>
</asp:HyperLinkColumn>

After I added VOID to JAVASCRIPT:, everything started working.

"Datagrid Girl [MVP]" <datagr...@operamail.com> wrote in message news:<eniT#WS3CH...@TK2MSFTNGP10.phx.gbl>...

Datagrid Girl [MVP]

unread,
Feb 26, 2003, 1:36:16 PM2/26/03
to
Interesting, I learned something today too then :) Who was your ASP.NET
instructor?

Take care,
Datagrid Girl
http://www.datagridgirl.com

"crjunk" <crj...@earthlink.net> wrote in message
news:e45e90aa.03022...@posting.google.com...

crjunk

unread,
Feb 28, 2003, 8:34:04 AM2/28/03
to
All I remember is his name was Mark and he was fom the Nasville area.

"Datagrid Girl [MVP]" <datagr...@operamail.com> wrote in message news:<#BlGzWc3...@TK2MSFTNGP09.phx.gbl>...

0 new messages