[MVC]ASP.NET MVC cookieless="true"導致Action Post無效!

[MVC]ASP.NET MVC cookieless="true"導致Action Post無效!

目前在測試登入畫面時,將cookieless設成"true",會導致我按下submit後,不會Run到Action Logon的Post Method,


<sessionState mode="StateServer" cookieless="true" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=pepa;password="  timeout="20"/>

如果要讓Post正常的話,View建立Form時要多指定action及controler,如下


@using (Html.BeginForm())
{
...
}
=>
@using (Html.BeginForm(ViewContext.RouteData.Values["action"].ToString(), ViewContext.RouteData.Values["controller"].ToString()))
{
...
}

Hi, 

亂馬客Blog已移到了 「亂馬客​ : Re:從零開始的軟體開發生活

請大家繼續支持 ^_^