Skip to main content

Posts

Showing posts with the label Events

ASP.NET MVC 5 (Part 2)

Before you start this tutorial, you should have the knowledge about, how to create an ASP .NET MVC   web application. MVC stands for the model- View- controller. MVC is an architectural pattern for developing applications that are well architectured, testable and easy to maintain. MVC application contains: Model : classes represent the data of the application. A model does not depend on the controller and view classes. View : Display the model data and send user action (button click) to the controller. Controller : provides the model data to the view and interprets user actions like button click. the controller depends on the model and the view. Controller Let 's start by adding a controller class in MVCProject .In Solution Explorer, right click on the controller folder and select controller.   In the Add scaffold dialogue box,  select MVC 5 controller-empty and then click Add. Name your controller FirstTest, and click the A...

How to write events in C#

We're going to display a simple message box when the button is clicked.So we need a coding window. To see the code for the button double click the button you added to the form. the coding window will open, and your cursor will be inside of the button code. It will look like this:   We want to display a message box, with some text on it. This is quite easy to do in C#. Position your cursor between the two curly brackets. Then type a capital letter "M". You'll see the IntelliSense list appear:            After type 'ess' You'll see the IntelliSense list appear:                                                                          When you have MessageBox selected, hit...