Click here to Skip to main content
15,901,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i write code in gridview in footer..in gridview fotter i have a button?i want to write code in that button. please give me sample code..
Posted

You can write any code you like, just add an event handler. There's really no other answer.
 
Share this answer
 
Hi Narayana0509,

Just to expose an example... Suppose you have the code for button in footer in your aspx page like:

XML
<FooterTemplate >
          <asp:Button ID="FooterButton" OnClick="FooterButton_Click" runat="server" Text="Footer Button" />
</FooterTemplate>


Just add an event handler in your code behind like:

C#
protected void FooterButton_Click(object sender, EventArgs e)
        {
            Response.Write("<SCRIPT>alert('You have clicked footer button.');</SCRIPT>");
        }


..and this will do what you need to.

Hope this helps.

Happy Coding :)
 
Share this answer
 
Comments
NARAYANA0509 21-Jul-12 6:51am    
Thank you.. it is more help to me..
Sunny_Kumar_ 21-Jul-12 7:14am    
well, that's good to hear about. Please don't forget to mark replies as answer if it solves the purpose. Good Luck !

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900