2015-02-08 66 views
-1

我是新手到Asp.net所以請原諒這個:)頁面元素停止響應

我加了一個超鏈接的HTML標記,像這樣

<h2><a class="iframe2 cboxElement" id="frameEdit" onclick="return OpenEditPage()">(EDIT)</a></h2> 

這裏是OpenEditPage()方法

<script> 
     function OpenEditPage() 
     { 
      var pid = document.getElementById("ProjId").value; 
      var link = document.getElementById("frameEdit"); 
      link.setAttribute('href', "/Project_MainPageEdit.aspx?editpid=" + pid); 
      return false; 
     } 
</script> 

雖然我點擊編輯超鏈接不久,編輯頁面中Iframe打開。但是,當我關閉編輯頁面時,我會返回到MainPage,但頁面上的所有按鈕和其他元素都無響應,直到我刷新頁面。

這是什麼原因?

回答

0

我添加下面的腳本中的代碼和它的工作就像一個魅力

$(document).ready(function() 
{ 
    $(".iframe2").colorbox({ onClosed: function() { window.location.reload(); } }); 
});