2010-09-13 52 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