jquery弹出窗口无法正常工作 [英] jquery popup not working

查看:87
本文介绍了jquery弹出窗口无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<script src="Scripts/jquery-ui.js" type="text/javascript"></script>
   <script src="Scripts/jquery-1.8.2.js" type="text/javascript"></script>
   <script type="text/javascript">
       function showmodalpopup() {
           $("#popupdiv").dialog({
               title: "jQuery Popup from Server Side",
               width: 430,
               height: 250,
               modal: true,
               buttons: {
                   Close: function () {
                       $(this).dialog('close');
                   }
               }
           });
       };
   </script>




<form id="form1" runat="server">
   <div>
       <asp:TextBox runat="server" ID="txtText"></asp:TextBox>
       <asp:UpdatePanel>
           <ContentTemplate>
               <div id="popupdiv" title="Basic modal dialog" style="display: none">
                   <asp:Label runat="server" ID="lblTextboxValue"></asp:Label>
               </div>
           </ContentTemplate>
       </asp:UpdatePanel>
       <asp:Button ID="btnShowModal" runat="server" Text="Show Popup" OnClick="btnShowModal_Click" />
   </div>
   </form>

< br $> b $ b






protected void btnShowModal_Click(object sender, EventArgs e)
  {
      lblTextboxValue.Text = txtText.Text;
      //ScriptManager.RegisterStartupScript(this, GetType(), "Show Modal Popup", "showmodalpopup();", true);
      ClientScript.RegisterStartupScript(this.GetType(), "Popup", "showmodalpopup();", true);

  }















i希望在标签lblTextboxValue中显示texbox txtText的文本框值,并使用jquery打开popupdiv作为popup







请帮助








i want to show textbox value from texbox txtText in label lblTextboxValue and open popupdiv as popup using jquery



please help

推荐答案

(#popupdiv)。dialog( {
title:来自服务器端的jQuery弹出窗口,
宽度:430,
高度:250,
模态:true,
按钮:{
关闭:function(){
("#popupdiv").dialog({ title: "jQuery Popup from Server Side", width: 430, height: 250, modal: true, buttons: { Close: function () {


(this).dialog('close');
}
}
});
};
< / script >
(this).dialog('close'); } } }); }; </script>




<form id="form1" runat="server">
   <div>
       <asp:TextBox runat="server" ID="txtText"></asp:TextBox>
       <asp:UpdatePanel>
           <ContentTemplate>
               <div id="popupdiv" title="Basic modal dialog" style="display: none">
                   <asp:Label runat="server" ID="lblTextboxValue"></asp:Label>
               </div>
           </ContentTemplate>
       </asp:UpdatePanel>
       <asp:Button ID="btnShowModal" runat="server" Text="Show Popup" OnClick="btnShowModal_Click" />
   </div>
   </form>

< br $> b $ b






protected void btnShowModal_Click(object sender, EventArgs e)
  {
      lblTextboxValue.Text = txtText.Text;
      //ScriptManager.RegisterStartupScript(this, GetType(), "Show Modal Popup", "showmodalpopup();", true);
      ClientScript.RegisterStartupScript(this.GetType(), "Popup", "showmodalpopup();", true);

  }















i希望在标签lblTextboxValue中显示texbox txtText的文本框值,并使用jquery打开popupdiv作为popup







请帮助








i want to show textbox value from texbox txtText in label lblTextboxValue and open popupdiv as popup using jquery



please help


1.在ASP页面中,首先需要注册/在 window.onload 事件中加载定义弹出窗口的javascript,然后在下一个例子中加载。



1.In you ASP page, first you need to have to register/load the javascript that define the popup in window.onload event then like in the next example.

window.onload = function () {


这篇关于jquery弹出窗口无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆