Pass a parameter with a method thought OnClick

Joined
Jun 29, 2010
Messages
4
Reaction score
0
Hi guys,

I want to do the next.

I got a populated DataGrid with 5 colums: id, name, address, email and download, the download column it's a ASP IMAGENBUTTON.

I would like to add a onClick event to the ASP BUTTON and pass thought it a parameter, but I need to send the current id's column regarding to the previously clicked row.

I wass thinkin in something likes this:

<ASP:TEMPLATECOLUMN>
<headertemplate>Exportar</headertemplate>
<ITEMTEMPLATE>
<ASP:IMAGEBUTTON id="ImageDelete" Runat="server" AlternateText="" ImageUrl="~/img/excel.png" onClick="sendPara(' <%# ( ( DataRowView ) Container.DataItem ) [ "id" ] %> ');"/>
</ASP:IMAGEBUTTON>
</ITEMTEMPLATE>
</ASP:TEMPLATECOLUMN>

but it doesn't work...

Do you have any advice guys?

Thank you in advance...
 
Joined
Jun 29, 2010
Messages
4
Reaction score
0
Any Idea guys?

any idea guys?

junk.rail said:
Hi guys,

I want to do the next.

I got a populated DataGrid with 5 colums: id, name, address, email and download, the download column it's a ASP IMAGENBUTTON.

I would like to add a onClick event to the ASP BUTTON and pass thought it a parameter, but I need to send the current id's column regarding to the previously clicked row.

I wass thinkin in something likes this:

<ASP:TEMPLATECOLUMN>
<headertemplate>Exportar</headertemplate>
<ITEMTEMPLATE>
<ASP:IMAGEBUTTON id="ImageDelete" Runat="server" AlternateText="" ImageUrl="~/img/excel.png" onClick="sendPara(' <%# ( ( DataRowView ) Container.DataItem ) [ "id" ] %> ');"/>
</ASP:IMAGEBUTTON>
</ITEMTEMPLATE>
</ASP:TEMPLATECOLUMN>

but it doesn't work...

Do you have any advice guys?

Thank you in advance...
 

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

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top