Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call function after button click 1

Status
Not open for further replies.

urtlking2jo

IS-IT--Management
Jul 25, 2003
4
I'm sure this has been answered, but I sure haven't been able to track it down. I've been told there is a way to run a code-behind function from an asp:button click (i.e., I have two buttons on the same page, and want one button to run a function, and the other button to run a separate function). Can someone confirm that this is possible and perhaps share a simple example assuming it is.

Thanks in advance,
Josh
 
Button.Click is an event. You need to assign a handler to the event. then whatever code is contained within the handler will be executed when the button fires.

double click the button in the IDE and a click event should be created in code behind (Click is the default event for a button). you can also manage the events in code, or manually write the declarative syntax in the markup.

MDSN Help and would be a good place to start learning how to utilize the asp.net framework.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top