Link to home
Start Free TrialLog in
Avatar of Zipbang
Zipbang

asked on

Using ASP.NET buttons in a listview instead of hyperlink

User generated image
What I want to do is use a button instead of a hyperlink on my listview items.  If you look at the image, it shows what I am after.  I can insert the button, but I need to know how to use it.

Right now, the hyperlink works like so:

<asp:HyperLink ID="HyperLink1" Text='<%# Eval("idpriority") %>'                
  NavigateUrl='<%# String.Concat("access_res.aspx?myvalue=", Eval("idpriority")) %>'                
runat="server"></asp:HyperLink>


I'd like to use the values of the record from the button control in the same way I am doing this in the hyperlink.

thank you.
Avatar of Ironhoofs
Ironhoofs
Flag of Netherlands image

You could use the ImageUrl of the hyperlink instead of the Text:

<asp:HyperLink ID="HyperLink1"  ImageUrl="<your image>" NavigateUrl='<%# String.Concat("access_res.aspx?myvalue=", Eval("idpriority")) %>' runat="server"></asp:HyperLink>
Avatar of Zipbang
Zipbang

ASKER

Thank you, but it is not the cosmetic attributes of the button I am after.  I would like to trigger VB code from the selection of this button.
The hyperlink will show the button instead of the text, while the function of the hyperlink remains the same. Clicking the button would trigger the VBCode in the same way that clicking the text does now.

Avatar of Zipbang

ASKER

I don't want to jump to a new page.  I would like to call a VB subroutine on the same page.
ASKER CERTIFIED SOLUTION
Avatar of Zipbang
Zipbang

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial