is there a way to call a function in asp.net using c# from code behind when a button is clicked.
Example in code behind i have a button,
Button btnRemove = new Button();
btnremove.OnClientclick = Remove(ID) something like that??
I want to call a function
public void Remove(int ID)
{
}
Thank you in advance!!
Client Side
If you use
OnClientClickyou call Javascript methodLink : http://msdn.microsoft.com/fr-fr/library/system.web.ui.webcontrols.button.onclientclick.aspx
Server Side
A If you want call server method you can use
OnClickB you can also override your Click delegate
Link : http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onclick.aspx