0

I'm developing portal in MVC 3. Have controller (MyController) with three methods Add (get and post verssion) and Index and part of add method looks like:

[HttpPost]
public virtual RedirectToRouteResult AddItem(Item item)
{
    (...)
    return RedirectToAction("Index");
}

Simple? Not fot me:) Item is added properly and when redirecting comes url looks like:

MyController/Index

and not:

mySite/MyController/Index

and of course that is bad news. This situation happens only in one case in one place in the whole portal. What's wrong?

4

2 に答える 2

0

戻り値として得られるのは、現在のパスに相対的な相対パスです。

于 2012-07-10T08:36:37.000 に答える
0

問題が解決しました-global.asax のルートマップの順序を変更する必要がありました-リクエストが間違ったマップでキャッチされました。

于 2012-07-10T09:30:20.947 に答える