1

我使用Razor开发了一个简单的ASP.NET MVC3项目。页面之间的链接,我请使用下表:ASP.NET MVC Razor Url.Action在Internet Explorer 8中不起作用

<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到ProblemEntrance索引页。在Mozilla和Chrome中一切正常,但使用Internet Explorer时,页面保持不变,并且不会对我的点击产生任何反应。任何想法我能做些什么呢?

回答

1

放在按钮上的href属性,然后勾了一个单击处理程序:

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

继承人fiddle

相关问题