Hi Ken,
Indeed that is the case, but unfortunately I don't think that the
HyperLink column supports the onclick attribute. I was trying to avoid
having to write any more code.
Mike
Ken Cox [Microsoft MVP] wrote:
> Hi Mike,
>
> I think you'll have the problem you are seeing until you move your
> JavaScript to the onclick event and take it off the href attribute. At
> least that's what I noticed the other day.
>
> Let us know?
>
> Ken
>
> "Mike Chamberlain" <> wrote in message
> news:...
>
>> 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:NewBareWin dow('/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
>
>
|