protected void Button1_Click(object sender, EventArgs e) { Button2_click()//Need to call Button2_click }
Button1_click
Button_2 click
private void button1_Click(object sender, EventArgs e) { //option 1 of calling button2 click by simulating the click event button2.PerformClick(); //option 2 of calling button2 click by calling the event itself button2_Click(sender, e); } private void button2_Click(object sender, EventArgs e) { MessageBox.Show("button2_Click"); }
protected void Button1_Click(object sender, EventArgs e) { RunThis(); }
protected void Button2_Click(object sender, EventArgs e) { RunThis(); }
public void RunThis() { //put the content of Button2_Click event here. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)