Connecting Tech Pros Worldwide Help | Site Map

GridView or HyperLinkField with call to a javascript function

SP
Guest
 
Posts: n/a
#1: Sep 12 '06
Hi,
I need a GridView that when I click on a row or on a HyperLinkField a
javascript call raise .
It is possible?

The grid is in a window open from a parent window. Onclick in a row
selected, a field in a opener is fill with the data of the row selected.

Thanks
KJ
Guest
 
Posts: n/a
#2: Sep 12 '06

re: GridView or HyperLinkField with call to a javascript function


Try something like:

<asp:HyperLinkField NavigateUrl="javascript:alert('hi there');"
Text="Hi There" />

SP wrote:
Quote:
Hi,
I need a GridView that when I click on a row or on a HyperLinkField a
javascript call raise .
It is possible?
>
The grid is in a window open from a parent window. Onclick in a row
selected, a field in a opener is fill with the data of the row selected.
>
Thanks
SP
Guest
 
Posts: n/a
#3: Sep 13 '06

re: GridView or HyperLinkField with call to a javascript function




KJ ha scritto:
Quote:
Try something like:
>
<asp:HyperLinkField NavigateUrl="javascript:alert('hi there');"
Text="Hi There" />
>
SP wrote:
Quote:
>Hi,
>I need a GridView that when I click on a row or on a HyperLinkField a
>javascript call raise .
>It is possible?
>>
>The grid is in a window open from a parent window. Onclick in a row
>selected, a field in a opener is fill with the data of the row selected.
>>
>Thanks
>


It seem not work, I have a link as :
<asp:HyperLinkField DataTextField="Field1" HeaderText="ID"
SortExpression="Field1"
NavigateUrl="javascript:returnData('{0}','{1}');"
datanavigateurlfields="Field1,Field2" target="_top"/>

In a GridView,but result is a link to "Field1".
Closed Thread