---
title: "Define Action Method in MVC"  
description: "Define Action Method in MVC"  
author: "Anonymous User"  
published: 2020-01-28  
updated: 2020-01-28  
canonical: https://www.mindstick.com/forum/155751/define-action-method-in-mvc  
category: "asp.net mvc"  
tags: ["asp.net mvc"]  
reading_time: 2 minutes  

---

# Define Action Method in MVC

[Explain me](https://www.mindstick.com/forum/34220/can-anyone-explain-me-about-off-page-activity) about [Action Method](https://www.mindstick.com/forum/160300/how-to-pass-data-to-an-httppost-action-method-in-a-dot-net-core-api) with using [URL](https://www.mindstick.com/forum/436/url-redirection) and also with example in MVC.

## Replies

### Reply by Nishi Tiwari

## [Action](https://www.mindstick.com/forum/155752/what-is-action-result-with-its-types) method

All the public methods of a Controller class are known as **Action methods**. They are similar to any other normal methods having the following restrictions:

1. Action method must be public. It cannot be private or protected

2. Action method cannot be overloaded

3. Action method can never be a static method.

4. Every controller has at least one default Action method Index() that returns the view page.

5. ActionResult is a base class of all the result type action methods.

This is an example of Index action method of StudentController

![Define Action Method in MVC](https://www.mindstick.com/mindstickforums/1e79328d-6552-4e57-b200-03a90b33b224/images/b57e4231-6162-447d-8c6b-5e98df1e39ce.png)

As we can see in the above example, **[Index method is a public method](https://www.mindstick.com/forum/155750/what-is-limitation-of-using-viewbag-and-ho-we-conquer-it)** and it returns ActionResult using the View() method and The View() method is defined in the Controller base class, which returns the ActionResult. \

## Action Methods & Urls in Asp.Net MVC

When any user want to access website or any application in asp.net mvc user enter its URL in browser

E.g. http://localhost:7575/PersonDetails/Index

In above URL we can clearly see that PersonDetails is controller and Index is action method which user may entering to invoke action method index by enter this URL in browser.

When controller gets request by the browser that controller will invoke method inside it. In case in which method not found in controller then it will show error saying http not found exception.

## Controller with Action Methods in Asp.Net MVC

The method with the ActionResult in asp.net mvc is known as Action Methods which return various View Results. For example given below we will see that Controller is a Class and Index is a Method in side that class. Here Index is the action method of PersonDetailsController

```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Tutorial3.Models;

namespace Tutorial3.Controllers
{
public class PersonDetailsController : Controller
{
//
// GET: /PersonDetails/
[HttpGet]
public ActionResult Index()
{
return View(newPerson());
}
}
}
```

This is how we can easily define action methods and urls for action methods in asp.net mvc application.


---

Original Source: https://www.mindstick.com/forum/155751/define-action-method-in-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
