button in headertemplate of gridview

G

Guest

I have this peice of code in my gridview

<HeaderTemplate>
<asp:ImageButton ID="btnPrevious"
ImageUrl="~/Images/Calendar/ico_Previous.png" runat="server" />
<asp:ImageButton ID="btnNext"
ImageUrl="~/Images/Calendar/ico_Next.png" runat="server" />
</HeaderTemplate>

How can I hook into the event handlers of these buttons i.e. when the user
clicks the button I want some server side code to execute but I cant figure
out how to hook up the code to the onclick event of the buttons?
 
A

Aytaç ÖZAY

Hi,

You must use gridview's itemcomand event's and a command name to the button
in the header's template column. The button in the gridview can't have it's
own events, so you must use gridview's itemcommand events.

Have a nice day,

Aytaç ÖZAY
Software Developer
 
A

Aytaç ÖZAY

You're wellcome.

If you have a problem for doing this, post the problem again.

Good luck,
Aytaç ÖZAY
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top