I have MyPage.aspx file and a button within. The button has server click event:
protected void Button_OnClick(object sender, EventArgs e) {
....
....
....
}
I have another file MyAshx.ashx file and I want to call the Button_OnClick function from it. Is there any to do this?
No, but you can extract / refactor the method body into a method in another class that is accessible to both. Your method body doesn’t use the object sender or EventArgs e arguments, does it?