GridView or HyperLinkField with call to a javascript function

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
 
K

KJ

Try something like:

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

SP

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top