Trouble finding where a Controller Action is being called

Posted on 2011-10-03
Last Modified: 2012-05-12
I have worked on MVC3 before. But am having a hard time finding where a given controller action is being called.

We use Ajax and I wonnder if that may be the reason it's hard for me to find.

I search for "MyActionName(" but it doees not show up.

Any suggestions?

Question by:newbieweb
    LVL 10

    Accepted Solution

    Lets say we have a "HomeController", and inside this controller we have an "Index(int id)" method.

    If I wanted to hit the Index method on the Home controller with AJAX, lets say using jQuery, I could have something like this:

            type: 'POST',
            url: '/Home/Index/' + id,
            success: function(data)
                   // do something with data

    or you could have just a link:

    <a href="/Home/Index/123">Click Me</a>

    or you could have mvc html helpers creating links for you such as:

    @Html.Action("Index", "Home")
    @Html.ActionLink("Click Me", "Index", "Home")

    or you might have a View with a form on it like this:

    @using (Html.BeginForm("Index", "Home", new { @id = 123 }))
          @* form elements here *@

    and any <input type="submit"> elements on the above form that get clicked would hit that method

    or you may check your global.asax file to see how the routing is working.  You may have a default route that is spilling into your method.

    Author Closing Comment

    THANKS! Great Answer!

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Join & Write a Comment

    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now