日期:2014-05-17  浏览次数:20468 次

jquery ui dialog 问题(添加到form1里面后还是无法使用服务器控件)
如题

<script language="javascript" type="text/javascript">
  $(document).ready(function() {
  $("#basic-modal-content").parent().appendTo("#form1");
  });
  </script>
添加到form1里面后还是无法使用 弹出层里的 <asp:ImageButton ID="btnLogin" runat="server" AlternateText="会员登录" ImageUrl="/image/login.gif" onclick="btnLogin_Click" /> 
  请问各位大侠如何解决呢?

------解决方案--------------------
代码看懂倒是没有问题,可我还是不清楚你的问题出在那一步 是提交没有反应? 是还提交之后有反应但没有执行过代码? 方便的话 你留个qq给我 我帮你看看
------解决方案--------------------
大概明白你的意思了。。。
服务器端控件,放在页面上可以响应后端的程序代码,用.dialog()弹出层里显示出来它就不响应了,是这样吧??

前端HTML:
HTML code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/ui-darkness/jquery-ui.css" />

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"  type="text/javascript"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js"  type="text/javascript"></script>
    <style type="text/css">
        div{margin:10px;}
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div id="d1">
            <asp:Button ID="Btn_Login" runat="server" Text="登录" onclick="Btn_Login_Click" />
        </div>
        <div>
            <input id="pop" type="button" value="弹出登录层" />
        </div>
    </form>
    <script type="text/javascript">
        $("#pop").click(function () {
            $("#d1").dialog({ modal: true });
        });
    </script>
</body>
</html>

------解决方案--------------------
$('#dialog').parent().appendTo($("form:first"))
这种试试