2012-10-29 60 views
0

在.ASPX視圖(不是剃鬚刀)中......是否有可能......或者......我如何修改mvc3 - 如何從控制器更新Html.BeginForm()的動作屬性

上的動作
Html.BeginForm("**ACTION**", "controllername", FormMethod.Post, new { id = "formId" })) 

從調用視圖之前的Controller的ActionResult視圖?

+0

感謝Subha更新我的問題的格式。 –

+0

下面的回覆只適用於Razor Views,我在這個項目中使用.aspx Views。 –

回答

0

您可以使用以下代碼來動態分配操作名稱。

@{ 
    String actionName = /*Assign action name based on the applying condition or using ViewBag you can also get it from controller.*/; 
} 
@using (Html.BeginForm(actionName, "Basic")) 
{ 

} 
相關問題