2017-10-04 13 views
0

これはlocalhostで動作するコードです。サブフォルダ内のHtml.BeginFormの使用方法

ビュー通知/ Index.cshtml:

@using(Html.BeginForm("Index","Notification",FormMethod.Post)) 
{ 
... 

しかし、これは、サーバー上で動作していません。 [送信]ボタンをクリックすると、これがURLになります。

http://test.com/Notification 

このURLが必要です。

http://test.com/subfolder/Notification 

私はサーバー上のドッカーを使用しているため、サブフォルダがあります。

答えて

0

はこのお試しください:

Html.BeginForm("Index", "Notification", new {area="subfolder"}, FormMethod.Post) 

をしかし、私はあなたがTagHelpersであなたのコードを書き換えることお勧め。

関連する問題