Write server side code in Windows Forms Application

Write server side code

We all know that the server side code written in code behind page. The c# server side code execute when some event of control fired like button click event.

Here, we take an example to execute server side code on button click event. When we make click on button then code will be executed which written on button click events. To go to button click events, double click on the button which we added on windows form. OR open button properties windows and click top of windows events button next to the properties icon.

Select Button Control -> Double click -> events

Button click events in windows application.

Here, button1_Click is a method of execute some code written in it. The button1 is a Id of the button control. When we change the Id of button control and then create click event the click event could be changed with new name. Write server side code in curly brackets for the button code.

private void button1_Click(object sender, EventArgs e)


Button click events in windows application.

We hope that this c#.net tutorial helped you to understand about write server side code in code behind page in windows application.

Next, c# windows application tutorial we will understand about comment c# code in windows application.


Leave a Reply

Your email address will not be published. Required fields are marked *