---
title: "How to overload controller in Asp.Net MVC?"  
description: "How to overload controller in Asp.Net MVC?"  
author: "Anonymous User"  
published: 2014-10-07  
updated: 2014-10-07  
canonical: https://www.mindstick.com/forum/2327/how-to-overload-controller-in-asp-dot-net-mvc  
category: "asp.net mvc"  
tags: ["asp.net", "asp.net mvc"]  
reading_time: 1 minute  

---

# How to overload controller in Asp.Net MVC?

Im curious to see if you can overload [controller](https://www.mindstick.com/blog/273/passing-values-from-controller-to-view-in-asp-dot-net-mvc) [methods](https://www.mindstick.com/articles/13060/runny-nose-remedy-methods-that-work-best) in [ASP.Net MVC](https://www.mindstick.com/forum/155798/what-is-caching-in-asp-dot-net-mvc). Whenever I try, I get the [error](https://yourviews.mindstick.com/view/88527/fixing-quickbooks-error-4120-reinstalling-vs-repairing) below. The two methods [accept](https://yourviews.mindstick.com/view/81278/we-have-to-accept-that-roger-federer-is-the-richest-one) different arguements. Is this something that cannot be done?

## Replies

### Reply by Anonymous User

Yes. I've been able to do this by setting the HttpGet/HttpPost (or equivalent AcceptVerbs attribute) for each controller method to something distinct, i.e., HttpGet or HttpPost, but not both. That way it can tell based on the type of request which method to use.

```
[HttpGet]        public ActionResult Show()        {           ...        }         [HttpPost]        public ActionResult Show(string userName)        {           ...        }
```

One suggestion I have is that, for a case like this, would be to have a private implementation that both of your public Action methods rely on to avoid duplicating code.\


---

Original Source: https://www.mindstick.com/forum/2327/how-to-overload-controller-in-asp-dot-net-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
