M
Mike Chamberlain
Hi.
Could someone help me with this simple problem?
I'm trying to open a new window from a HyperLink column in my datagrid.
The definition of the column is as follows:
<asp:HyperLinkColumn Text="..."
DataNavigateUrlField="master_id_account"
DataNavigateUrlFormatString="javascript:NewBareWindow('/Accounts/Edit.aspx?masterIdAccount={0}',
'Account{0}', 750, 550);">
</asp:HyperLinkColumn>
And this emits the following HTML:
<td>
<a
href="javascript:NewBareWindow('/Accounts/Edit.aspx?masterIdAccount=1211482',
'Account1211482', 750, 550);">...</a>
</td>
I have a javascript function NewBareWindow() that wraps the javascript
window.open() function. The above works fine except for one small
problem. The new window opens as expected, but the URL of the original
window also changes, the page displaying just the word "false",
presumably because my NewBareWindow function returns false. If I make
the function return nothing, then [object] is displayed instead of false.
How do I stop the original page changing when the link is clicked? I'm
trying to do this only using the VS.NET Datagrid property builder.
Also, as an experienced web developper, I'm sure I have managed to do
this correctly countless times before, but I can't seem to get it to
work here!
Mike
Could someone help me with this simple problem?
I'm trying to open a new window from a HyperLink column in my datagrid.
The definition of the column is as follows:
<asp:HyperLinkColumn Text="..."
DataNavigateUrlField="master_id_account"
DataNavigateUrlFormatString="javascript:NewBareWindow('/Accounts/Edit.aspx?masterIdAccount={0}',
'Account{0}', 750, 550);">
</asp:HyperLinkColumn>
And this emits the following HTML:
<td>
<a
href="javascript:NewBareWindow('/Accounts/Edit.aspx?masterIdAccount=1211482',
'Account1211482', 750, 550);">...</a>
</td>
I have a javascript function NewBareWindow() that wraps the javascript
window.open() function. The above works fine except for one small
problem. The new window opens as expected, but the URL of the original
window also changes, the page displaying just the word "false",
presumably because my NewBareWindow function returns false. If I make
the function return nothing, then [object] is displayed instead of false.
How do I stop the original page changing when the link is clicked? I'm
trying to do this only using the VS.NET Datagrid property builder.
Also, as an experienced web developper, I'm sure I have managed to do
this correctly countless times before, but I can't seem to get it to
work here!
Mike