Solved

GridView Footer Button Custom Eventhandler?

Posted on 2011-03-01
3
483 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SignalR - getting new data from sql DB 5 79
JavaScript error 1 52
Hidden Field Value 10 60
C# MVC and a global static factory that never dies 4 46
AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now