Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JS Alert with CommandArgument

Status
Not open for further replies.

JimmyFo

Programmer
Feb 14, 2005
102
US
Hi, in a gridview, I've set the commandargument during a rowdatabound event. What I'd like to do now is when an icon is clicked, have a Javascript alert popup the command argument (this leads to something else).

How can I access the command argument? Is there a server tag I could use?

I'd appreciate any help - thanks!

Code:
<asp:ImageButton ID="ImageButton3" OnClientClick="alert(' COMMANDARGUMENT? ')" ImageUrl="~/images/status/search.png"

James
 
try this (IE Only):

OnClientClick="alert(this.outerHTML)"

that will give you the ENTIRE tag content, usually command arguement is one of the parameters in the JavaScript function __doPostBack() that is used by .NET.

Once you confirm the exact location, you can use DOM to retrieve the values...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top