2010-09-13 47 views
0

我正在使用jQuery加載模式彈出窗口上的細節。該網址由Html.Grid()上點擊的項目決定。無法在jQuery上加載視圖dialog.load()

以下是在.aspx代碼:

<script type="text/javascript"> 
     $(document).ready(function() { 
      //define config object 
      var dialogOpts = { 
       modal: true, 
       bgiframe: true, 
       autoOpen: false, 
       height: 500, 
       width: 500, 
       draggable: true, 
       resizeable: true, 
       open: function() { 
        //display correct dialog content 
//     $("#example").load("HQBalanceList"); 
       } 
      }; 
      $("#example").dialog(dialogOpts); //end dialog 

      $('.modal').click(
     function() { 
      debugger; 
      var $this = $(this); 
      var url = $this.attr("href"); 
      $("#example").load(url); 
      $("#example").dialog("open"); 
      return false; 
     } 
    ); 

     }); 
    </script> 

<div style="display: none; border: 1;" id="example" title="My First Ajax Dialog"></div> 

的一個標籤應用了一個名爲模態類。他們是這樣的:

<a class="modal" href="/Account/Balance?sp3=Code&amp;dateID=3">Code</a> 

我可以看到模式彈出。但它沒有顯示數據。我已經調試到代碼中,並可以看到正在傳遞適當的視圖。

我是jQuery的新手。任何幫助是極大的讚賞。

謝謝:)

回答

0

也許它顯示的內容,但由於#示例DIV是隱藏與顯示:無,它裏面的一切也隱藏。嘗試在對話框調用之前插入

$('#example').css('display', 'block');

,並再次隱藏它關閉。

+0

我試過這個,但徒勞無功!顯然,顯示不是問題,因爲我能夠在彈出窗口中看到靜態數據。 – 2010-09-14 04:16:38