[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

GridView Footer Button Custom Eventhandler?

Posted on 2011-03-01
3
Medium Priority
?
494 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 500 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 500 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month19 days, 1 hour left to enroll

834 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