5
votes

here is my root controller :

    [HttpPost]
    public ActionResult Index()
    {
    }

but it couldn't load project it give me :

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.

1
without httppost it works but I need a parameterless method with http post - kamiar3001
I just need HttpPost I need a parameterless method to rise if Index(model) couldn't rise. it must be worked I don't know why ? - kamiar3001

1 Answers

6
votes

Try this

public ActionResult Index()
{
}

[HttpPost, ActionName("Index")]
public ActionResult IndexPost()
{
}

The ActionName attribute enables you to create a method of one name that relates to another