• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1036
  • Last Modified:

Add Attributes to a Hyperink Control within The Gridview RowDataBound Event

Hi All

I have a template column within my Gridview which contains a hyperlink control. I need to add the following jscript to it, please could anyone suggest a way:

onClick="exopen('mypage.aspx');return false;"

I envisaged it being done within the Gridview's RowDataBound event but not sure on the approach.

Rit
0
rito1
Asked:
rito1
  • 2
1 Solution
 
Bob LearnedCommented:
You could do that in the HTML designer for the GridView, since it is not a dynamic string.

Bob
0
 
Abu HamdanEnterprise Architect, PM ExpertCommented:
Try solution on this thread:
http://forums.asp.net/p/1156039/1899427.aspx
0
 
rito1Author Commented:
Hi

The link should look like this so i need to add the attribute onclick..

<a id="ctl00_ContentPlaceHolder1_GridView1_ctl02_HyperLink1" onClick="exopen('mypage.aspx');return false;" href="mypage.aspx"><img src="trolley.gif" alt="buy" style="border-width:0px;" /></a>
0
 
rito1Author Commented:
... OnClientClick doesn't seem to be supported on a HyperLink control
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now