Introduction : This is a simple ASP.NET MVC application that performs arithmetic operations. ASP.NET MVC is the advanced version of ASP.NET. MVC is the three separated part that name is the models,views,controllers. Every part performs different work in an ASP.NET MVC application. Models is perform the business logic, Views is provide the graphical user interface and last controller handle all views and models request. In this example we simple perform the arithmetic operation addition, subtraction, multiplication and division. In this program first we create the business logic add a class in model folder and second is pass the request in controller folder after that create a view. This is the simple application for beginners that help how to perform the arithmetic operation using ASP.NET MVC tools.
Step1: Open the MVC ASP.NET application.
- Open Visual Studio 2010.
- Click file ->New->Projects.
- Add a MVC ASP. NET 2 Empty Web application.

Step2: Add business logic in Models folder.
- Right Click the models folder and add a class.
- Right Click->add ->add new items->add class.
- The Class name is "manish".


Code:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
namespace
math123.Models
{
public class
Manish
{
public int
sum(int a, int
b)
{
int c = a + b;
return c;
}
public
int sub(int a,
int b)
{
int c = a + b;
return c;
}
public int
mul(int a, int
b)
{
int c = a * b;
return c;
}
public int
div(int a, int
b)
{
int c = a / b;
return c;
}
}
}
Step 3: Add a controller.
- Right Click the controllers folder and add a controller.
- Right Click->add ->add controller.
- Controller name is "manu"
- Add namespace in controller that name is "using math123.Models".


Code :
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.Mvc;
using
math123.Models;
namespace
math123.Controllers
{
public class
manuController :
Controller
{
//
// GET: /manu/
public
ActionResult Index()
{
Manish man =
new Manish();
man.sum(10,20);
man.sub(30, 10);
man.mul(10, 50);
man.div(100, 5);
return View(man);
}
}
}




Chauhan BhavikPosted Sep 21, 2015, 2:04 AM
how can i solve this error..
Chauhan BhavikPosted Sep 21, 2015, 2:03 AM
Server Error in '/' Application.The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /Index.aspx Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929
Former memberPosted Jan 4, 2012, 1:19 PM
Hello dear My name is madina.i am interested in having a relationship with you and being your friend.i'm romantic and young Girl,you can send an email to my email address ([email protected]) so that I can send you more details about my self Including my picture.