Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Pass a parameter with a method thought OnClick

Reply
Thread Tools

Pass a parameter with a method thought OnClick

 
 
junk.rail junk.rail is offline
Junior Member
Join Date: Jun 2010
Posts: 4
 
      06-29-2010
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...
 
Reply With Quote
 
 
 
 
junk.rail junk.rail is offline
Junior Member
Join Date: Jun 2010
Posts: 4
 
      06-30-2010
any idea guys?

Quote:
Originally Posted by junk.rail
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...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pass a parameter for a function parameter in a function AzamSharp Javascript 2 07-05-2008 12:24 AM
How to pass a C# parameter as an argument of a javascript method ? PhilTheGap ASP .Net 6 06-13-2008 07:40 AM
How to pass a parameter using the dom in a.onclick = function() {...} event? SM Javascript 2 05-27-2007 11:02 AM
Pass bool parameter to web method Baohua Li ASP .Net Web Services 3 01-20-2004 07:18 AM
document.onclick=doIt() same as document.onclick=doIt ? bob Javascript 3 08-21-2003 12:14 PM



Advertisments