jQuery的模式弹出窗口 [英] Jquery for modal popups

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

问题描述

大家好,
我遇到了ASP.NET Web应用程序问题(使用.NET Framework 3.5).
我有一个名为Enrollment的aspx页面,其中包含一个名为InlineProviderSearch.ascx的用户控件.用户控件基本上将用于根据用户输入的某些条件搜索提供者信息.现在,用户控件包含两个div标签(一个名为dvCity,另一个名为dvNotification).单击搜索"按钮后,我将调用一个传递城市名称或邮政编码,半径(以英里为单位),姓氏/名字的Web服务.基于这些参数,WS返回一个城市列表.现在,如果存在完全匹配的内容,则基于该城市的搜索结果将返回,否则需要像浮动div一样弹出div标签(dvCity).这将显示一个城市列表,用户可以从中选择特定城市.
现在,当div弹出时,屏幕应变灰,并且只有div像模式弹出窗口一样可见.我尝试使用Jquery来执行此操作,但背景不会变灰.我还使用了Ajax ModalPopupExtender控件,该控件在这里可以正常工作,但是我需要使用Jquery,因为这是客户端的方法.以下是代码段:

Hi All,
I''m facing an issue with ASP.NET Web Application (using .NET Framework 3.5).
I''ve a aspx page called Enrollment that contains a user control named InlineProviderSearch.ascx. The user control will basically be used for searching provider information based on some criteria input by the user. Now the user control contains two div tags (one named dvCity and another dvNotification). On click of the Search button, I call a Web Service passing the city name or zip code, radius (in miles), lastname/firstname. Based on these parameters, the WS returns a list of city. Now if there is a exact match, then search result based on that city will returned else the div tag (dvCity) needs to be popped up like a floating div. This will show a list of cities from which user can select a particular city.
Now when the div pops up the screen should be grayed out and only the div shall be visible like a modal popup. I have tried using Jquery to do so but the background doesn''t grey out. Also I''ve used Ajax ModalPopupExtender control that works fine here but I need to use the Jquery since that is the client''s approach. Below is the code snippet:

<script type="text/javascript">
    function cityPopUp() {
        $.blockUI({ message: $(''#<%=dvCity.ClientID%>''), css: { width: ''500px'', height: ''120px'', top: ''25%'', left: ''25%''} });
        return false;
    }
   
    function confirmationPopUp() {
        $.blockUI({ message: $(''#dvNotification''), css: { width: ''500px'', height: ''120px'', top: ''25%'', left: ''25%''} });
        return false;
    }
    $(document).ready(function () {
        $(''#btnConfirm'').click(function () {
            $.unblockUI();
            return true;
        });
        $(''#btnCancel'').click(function () {
            $.unblockUI();
            return false;
        });
       
    }); 
</script>


同样对于确认弹出窗口(显示dvNotification div),jQuery根本不起作用.我收到如下Javascript错误:
Microsoft Jscript RuntimeError:对象不支持此属性或方法.
调用blockUI时发生此错误.这两个div标签(dvCity和dvNotification)都会发生这种情况.
有人可以让我知道如何使用Jquery在背景变灰的情况下显示模式弹出窗口(如浮动div)吗?

谢谢,
Debsoft


Also for the confirmaton popup (showing the dvNotification div), the jquery doesn''t work at all. I get a Javascript error as below:
Microsoft Jscript RuntimeError: The object doesn''t support this property or method.
This error occurs when the blockUI is called. This happens for both the div tags (dvCity and dvNotification).
Can someone let me know how one can use Jquery to display modal popups (like floating divs) with the background grayed out?

Thanks,
Debsoft

推荐答案

.blockUI({消息:
.blockUI({ message:


(''#<%= dvCity.ClientID%>' '),css:{宽度:"500px",高度:"120px",顶部:"25%",左侧:"25%"}}); 返回false; } function ConfirmationPopUp(){
(''#<%=dvCity.ClientID%>''), css: { width: ''500px'', height: ''120px'', top: ''25%'', left: ''25%''} }); return false; } function confirmationPopUp() {


.blockUI({消息:
.blockUI({ message:


这篇关于jQuery的模式弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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