Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a C# function in a .cs file. I have a html button in a .aspx page. I have to call that function when the button is clicked. How do I do that?
Posted
Updated 30-Mar-10 21:20pm
v2

1 solution

Add an asp:Button to the page in design view. Double-click the button. VS will create a new event in code behind for you. Call your function from this event.

If you really must use an html button then add ID and runat=server attributes and create an event in code behind from which to call your function.
 
Share this answer
 
v2

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