开发者

Mvc http post method gives me "The resource cannot be found. "

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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜