我使用MVC2/asp.net並嘗試開發類似嚮導的東西。這個嚮導將有幾個網站。 用戶將能夠在網站A上輸入一些信息,然後導航到網站B(通過按下觸發Http.Post事件的按鈕)。 到目前爲止沒有問題。如何識別是否按下「返回」按鈕或「前進」按鈕?
同樣在網站B上,用戶可以輸入一些信息。但是他有兩個按鈕:「後退」和「前進」。
如何在這裏識別哪個按鈕被按下?
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Step2(Model model, FormCollection Form)
{
...
}
「後退」/ 「前進」 按鈕看起來像這樣:
INPUT TYPE = 「圖像」 名稱= 「返回按鈕」 ID = 「返回按鈕」 SRC =「HTTP:// .. .whatever .../Resources/Images/Button/BackButton.gif「alt =」Back「/>
input type =」image「name =」ForwardButton「id =」ForwardButton「src =」http:// ...無論.../Resources/Images/Button/Forward.gif「alt =」Forward「/>
非常感謝您爲您的快速和良好的重播! 你說得對。 FormCollection僅包含按下的按鈕。 – user415876 2010-08-16 08:59:44