Using ASP.NET buttons in a listview instead of hyperlink

Zipbang used Ask the Experts™
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")) %>'                

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.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
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>


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.


I don't want to jump to a new page.  I would like to call a VB subroutine on the same page.
It appears that I've solved th is:

This is what I was looking for.

<asp:LinkButton id="LinkButton1" Text='<%# Eval("IDpriority") %>' OnClick="LinkButton_Click" runat="server"/>

This will aloow me to execute VB code from what appears to be a hyperlink

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial