1

Razorを使用して単純なASP.NETMVC3プロジェクトを開発しました。ページ間のリンクには、次の表を使用します。

<table class="indexTable" align="left">
    <tr>
        <td class="indexTd">
        <a class="noUL" href='@Url.Action("Index", "ProblemEntrance")'><button class="menuButton">@ViewBag.ProblemEntrance</button></a>
        </td>

したがって、ProblemEntranceをクリックすると、ProblemEntranceControllerからProblemEntranceIndexページに移動します。MozillaとChromeではすべて正常に動作しますが、Internet Explorerを使用すると、ページは同じままで、クリックに対して何の反応もありません。私がそれについて何ができるか考えていますか?

4

1 に答える 1

1

ボタンにhref属性を配置し、クリックハンドラーをフックします。

<button href='@Url.Action("Index", "ProblemEntrance")' class="menuButton" onclick='location.href=this.getAttribute("href")'>@ViewBag.ProblemEntrance</button>

ここにフィドルがあります。

于 2012-12-04T05:47:43.993 に答える