GridView or HyperLinkField with call to a javascript function

  • Thread starter Thread starter SP
  • Start date Start date
S

SP

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
 
Try something like:

<asp:HyperLinkField NavigateUrl="javascript:alert('hi there');"
Text="Hi There" />
 
KJ ha scritto:
Try something like:

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



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".
 
Back
Top