同樣的Server Code,兩家瀏覽器的內容竟然不一樣,來看一下,到底差多少?
Mozilla FireFox
<aonclick="WebForm_DoCallback('ctl00$MainContent$WebPartManager1$VerbWebPart1','RefreshAjax',function(result, controlId){ document.getElementById(controlId).innerHTML = result;},'MainContent_WebPartManager1_VerbWebPart1',null,false);"title="Refresh the data2"href="javascript:__doPostBack('','')"><img title="Refresh the data2" src="/WebResource.axd?d=b0mWHY8S-KhFmq2i0Ng64vjCr7jtn6d1PqDQASYhlciLFSkUesn25v94jo0Hl8v3SSeikIor9zVbWy0TKuelog2&t=634156742020331178"alt="Refresh2"></a>
Internet Explorer
<a title="Refresh the data2"href="javascript:void(0)"onclick="document.body.__wpm.Execute('WebForm_DoCallback(\'ctl00$MainContent$WebPartManager1$VerbWebPart1\',\'RefreshAjax\',function(result, controlId){ document.getElementById(controlId).innerHTML = result;},\'MainContent_WebPartManager1_VerbWebPart1\',null,false);')" class="menuItem"><img src="/WebResource.axd?d=b0mWHY8S-KhFmq2i0Ng64vjCr7jtn6d1PqDQASYhlciLFSkUesn25v94jo0Hl8v3SSeikIor9zVbWy0TKuelog2&t=634156681268366365"alt="Refresh the data2"width="16"height="16"style="border-style:none;vertical-align:middle;" /> Refresh2 </a>
在FireFox中,多送了一次PostBack,所以CallBack的結果被洗掉了。
解決方式:在Web Part页面上添加AJAX。
沒有留言:
張貼留言