Solved

GridView Footer Button Custom Eventhandler?

Posted on 2011-03-01
3
487 Views
Last Modified: 2012-05-11
I know about using the GridView RowCommand eventhandler to catch button commandName. Just wondering if there is a way to make a custom eventhander much like using Windows Forms where double-clicking a new button in designer creates a new eventhandler (ie... button1_click).
0
Comment
Question by:pointeman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Accepted Solution

by:
ChetOS82 earned 125 total points
ID: 35008634
There is no automatic way (like double-clicking), but you can put an OnClick event like this:

<asp:Button runat="server" ID="button1" OnClick="button1_Click" Text="button" />

in the code-behind:

protected void button1_Click(System.Object sender, System.EventArgs e) {

}
0
 
LVL 29

Assisted Solution

by:Paul Jackson
Paul Jackson earned 125 total points
ID: 35008688
What do you want to do create an event handler for button click ?
Is your button a server control i.e. <asp:Button ...
Go to your code-behind page, at the top of the screen you have 2 dropdownl;istboxes. In the left hand one select the control you want to create an event for, in the right hand one select the event type you want to handle.

If the event handler exists it will take you to it.
If it doesn't it will create the outline of the event handler.

Hope this is what you were after.
0
 

Author Closing Comment

by:pointeman
ID: 35011946
very nice, thanks....
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question