Click here to Skip to main content
15,887,446 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: MCV How To? Controller Action that doesn't do anything Pin
2374121-Feb-16 5:29
2374121-Feb-16 5:29 
GeneralRe: MCV How To? Controller Action that doesn't do anything Pin
Foothill21-Feb-16 5:38
professionalFoothill21-Feb-16 5:38 
GeneralRe: MCV How To? Controller Action that doesn't do anything Pin
2374121-Feb-16 5:50
2374121-Feb-16 5:50 
GeneralRe: MCV How To? Controller Action that doesn't do anything Pin
Foothill21-Feb-16 5:52
professionalFoothill21-Feb-16 5:52 
GeneralRe: MCV How To? Controller Action that doesn't do anything Pin
2374121-Feb-16 5:55
2374121-Feb-16 5:55 
AnswerRe: MCV How To? Controller Action that doesn't do anything Pin
Nathan Minier22-Feb-16 2:39
professionalNathan Minier22-Feb-16 2:39 
GeneralRe: MCV How To? Controller Action that doesn't do anything Pin
Foothill22-Feb-16 3:12
professionalFoothill22-Feb-16 3:12 
GeneralRe: MCV How To? Controller Action that doesn't do anything Pin
Nathan Minier22-Feb-16 3:53
professionalNathan Minier22-Feb-16 3:53 
No, not out of the box. The closest way to return nothing from an ActionResult returning method is the aforementioned EmptyResult.

That said, there is a way to do something similar by adding a route and a void method.

RouteConfig.cs
C#
...
routes.MapRoute(
   "DetailOverload",
   "Department/Details",
   new { controller = "Department", action = "VoidDetails" }
);

routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );

DepartmentController.cs
C#
public void VoidDetails()
{
   // do nothing!
} 

public ActionResult Details(int id)
{
  // do something!
}

This is basically the .NET MVC baked-in way to modify action calls.
GeneralRe: MCV How To? Controller Action that doesn't do anything Pin
Foothill22-Feb-16 4:10
professionalFoothill22-Feb-16 4:10 
GeneralRe: MCV How To? Controller Action that doesn't do anything Pin
Nathan Minier22-Feb-16 4:31
professionalNathan Minier22-Feb-16 4:31 
GeneralRe: MCV How To? Controller Action that doesn't do anything Pin
Foothill22-Feb-16 4:59
professionalFoothill22-Feb-16 4:59 
QuestionHighlight text in the pdf. Pin
er.durgesh17-Feb-16 22:47
er.durgesh17-Feb-16 22:47 
QuestionNetTiers is creating Delete methods twice need some help Pin
indian14317-Feb-16 14:35
indian14317-Feb-16 14:35 
QuestionASP.Net VB: Dynamic refresh of webpage after completion of asynchronous task Pin
ajaysh7317-Feb-16 14:20
ajaysh7317-Feb-16 14:20 
Questioncascading with javascript Pin
Luis Oliveira 196617-Feb-16 5:40
Luis Oliveira 196617-Feb-16 5:40 
QuestionGridView behaving Strangely in an asp.net web page. Pin
Member 1221350616-Feb-16 7:08
Member 1221350616-Feb-16 7:08 
AnswerRe: GridView behaving Strangely in an asp.net web page. Pin
Richard Deeming16-Feb-16 7:27
mveRichard Deeming16-Feb-16 7:27 
GeneralRe: GridView behaving Strangely in an asp.net web page. Pin
Member 1221350616-Feb-16 7:33
Member 1221350616-Feb-16 7:33 
QuestionHow to create a language translator in asp.net using c#? Pin
Raja Ganapathy16-Feb-16 2:15
Raja Ganapathy16-Feb-16 2:15 
AnswerRe: How to create a language translator in asp.net using c#? Pin
Richard MacCutchan16-Feb-16 3:15
mveRichard MacCutchan16-Feb-16 3:15 
Questionhave a problem in custom control with javascript Pin
Member 1207470715-Feb-16 18:57
Member 1207470715-Feb-16 18:57 
SuggestionRe: have a problem in custom control with javascript Pin
Kornfeld Eliyahu Peter15-Feb-16 20:06
professionalKornfeld Eliyahu Peter15-Feb-16 20:06 
QuestionTelerik TreeList Child Level Items are not retrievable by using FindItemByKeyValue method Pin
indian14312-Feb-16 16:53
indian14312-Feb-16 16:53 
Questionproper use of System.Web.HttpContext.Current.User Pin
jkirkerx12-Feb-16 12:56
professionaljkirkerx12-Feb-16 12:56 
AnswerRe: proper use of System.Web.HttpContext.Current.User [Not Solved but I get it now] Pin
jkirkerx13-Feb-16 13:53
professionaljkirkerx13-Feb-16 13:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.