How can i click button programmatically?
Q: How can i click button programmatically?
Okay, Some of the experts will say call btn_click(sender,eventargs); You are right expert.. But i would like to do as below:
I have one User control which has : Two Textbox and one button(btnSave) — and one click event associated with it(btnSave_Click).
I have used this control on my page say Default.aspx — Now, From Default.aspx. I would like to call btnSave_Click on one of my button kept on Default.aspx say FinalSave. So experts how can i do this?😦
Okay, This simple guy have a solution it is as follow:
1. Find button control using FINDCONTROL Method.
Button fondButton = UserControl1.FindControl(“btnSave”);
2. Call Button click using following way:
isn’t it a cool way to call button click??
Thanks to this guy for nice post :