Click here to Skip to main content
15,886,105 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Is this possible to call page load event on button click in C#.Net window form application.
Posted

just need to pass null values to your form_load event

C#
this.Form1_Load(null,null);
 
Share this answer
 
v3
Comments
Uday P.Singh 13-Oct-11 8:02am    
my 5!
You can call any method or event from any other event or method.

if you are not handling the sender and EventArgs just pass null values.
 
Share this answer
 
Comments
Uday P.Singh 13-Oct-11 7:59am    
agree my 5!
Mehdi Gholam 13-Oct-11 8:01am    
Thanks
Anuja Pawar Indore 13-Oct-11 9:55am    
Well said :)
Mehdi Gholam 13-Oct-11 10:29am    
Thanks
madhuri@mumbai 2-Nov-12 3:17am    
agree!!
C#
protected void Page_Init(object sender, EventArgs e)
{
      Button1.Click += new EventHandler(Button1_Click);
}

 void Button1_Click(object sender, EventArgs e)
{
}


Try this one, but its for web application
 
Share this answer
 
simply pass the null values to

Form1_Load(null,null);
 
Share this answer
 

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