Jump to content
Xtreme .Net Talk

javascript:window.open() in a DataGrid HyperlinkColumn


Recommended Posts

Guest rpeters
Posted

please reference:

http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=219

 

I have a hyperlinkcolumn in a datagrid which fires off a javascript from the DataNavigateUrlFormatString that looks like:

 

"javascript:window.open('Report.aspx?Report=Sample');"

 

The new window opens fine. The problem is that the browser window where the javascript is called loads in a page with "[Object]" as the only thing on it. I do not want the calling page to go anywhere. This is a javascript issue.

 

any help is appreciated ...

 

rpeters

Posted

Hi rpeters,

 

I had exactly the same problem with this, and I eventually got it sorted, the only problem is, I am at home now and my solution is at work.

 

Taking a lucky dip in my memory, try setting a variable equal to the window.open method.

 

javascript:varRpt=window.open('Report.aspx?Report=Sample');

 

If this doesn't work let me know as I know I've solved this before.

 

Gazzo.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...