ajax modelpop扩展程序 [英] ajax modelpop extender

查看:96
本文介绍了ajax modelpop扩展程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我为了这个东西把我的头撞在墙上.
我已经创建了Ajax模型弹出框
我收到模型弹出框,当我单击按钮打开时,一秒钟后它自动关闭,这是我的问题
我的示例代码是

hi
iam banging my head to the wall for this thing.
i had created the Ajax model pop box
i am getting the model pop box, when i click on the button it was opening and after one second it was closing automatically,this was my problem
my sample code is

<asp:ScriptManager ID="ScriptManager1" runat="server"/>

<asp:ModalPopupExtender ID="ModalPopUpExtender" runat="server"
TargetControlID="Button"
PopupControlID="Panel1"
CancelControlID="btnCancel" />

<asp:Button
ID="Button"
runat="server"
Text="Click Here"
onclick="Button_Click" />

<asp:Panel ID="Panel1"
runat="server"
Height="247px"
Width="462px"
BorderColor="Blue"
BorderWidth="10px">

<asp:RadioButtonList ID="RadioButtonList1" runat="server">

<asp:ListItem Value="1″>Asp.net

<asp:ListItem Value="2″>C#

<asp:ListItem Value="3″>SQL Server



<asp:Button
ID="btnCancel"
runat="server"
Text="Cancel" />





在default.aspx.cs

按钮点击代码为





in default.aspx.cs

button click code is

ModalPopUpExtender.Show();


所以,问题是什么,我的要求是盒子应该保持在用户手动关闭的状态.

请帮助我,


so, what is the problem , my requirement is that box should stay upto the user closes manually

please help me out from this,

推荐答案

由于已经设置了目标控件,因此无需显示弹出窗口.

另外,检查调用弹出扩展程序的按钮是否导致回发,如果确实如此,则将其删除.

问候,
爱德华(Eduard)
No need to show the popup since you already set its target control.

Also, check the button calling the popup extender if it causes postback, if it does, remove it.

Regards,
Eduard


我尝试了您的代码.我做了一些修改,请参见下文.
<%@页面语言="C#" AutoEventWireup ="true" CodeFile ="Default.aspx.cs" Inherits ="_ Default"%>

<%@注册程序集="AjaxControlToolkit"命名空间="AjaxControlToolkit" TagPrefix ="cc1"%>

<!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>
</head>
< body>
< form id ="form1" runat ="server">
< div>
< asp:ScriptManager ID ="ScriptManager1" runat ="server">
</asp:ScriptManager>


< cc1:ModalPopupExtender ID ="ModalPopUpExtender" runat ="server"
TargetControlID ="Button"
PopupControlID ="Panel1"
CancelControlID ="btnCancel"/>

< asp:Button ID ="Button" runat ="server" Text ="Click Here" onclick ="Button_Click"/>

< asp:Panel ID ="Panel1"
runat ="server"
高度="247px"
宽度="462px"
BorderColor ="Blue"
BorderWidth ="10px"/>

< asp:RadioButtonList ID ="RadioButtonList1" runat ="server"/>




< asp:Button ID ="btnCancel" runat ="server" Text ="Cancel"/>

</div>
</form>
</body>
</html>
i tried ur code.i made some modification see below.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>


<cc1:ModalPopupExtender ID="ModalPopUpExtender" runat="server"
TargetControlID="Button"
PopupControlID="Panel1"
CancelControlID="btnCancel" />

<asp:Button ID="Button" runat="server" Text="Click Here" onclick="Button_Click" />

<asp:Panel ID="Panel1"
runat="server"
Height="247px"
Width="462px"
BorderColor="Blue"
BorderWidth="10px"/>

<asp:RadioButtonList ID="RadioButtonList1" runat="server"/>




<asp:Button ID="btnCancel" runat="server" Text="Cancel" />

</div>
</form>
</body>
</html>




您已经将目标控件ID指定为按钮,然后为什么再次在单击按钮时显示模式弹出窗口.(不需要)

看下面的代码.

Hi,

You have already specified the target control id as button then why you are again showing the modal pop up on button click.(its not required)

Have a look on the following code.

<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:Button ID="Button1" runat="server" Text="Button" />
        <asp:ModalPopupExtender ID="Button1_ModalPopupExtender" runat="server" TargetControlID="Button1"

            PopupControlID="Panel1" CancelControlID="btnCancel">
        </asp:ModalPopupExtender>
        <asp:Panel ID="Panel1" runat="server">
            <asp:RadioButtonList ID="RadioButtonList1" runat="server">
                <asp:ListItem Value="1">Test</asp:ListItem>
                <asp:ListItem Value="2">Test 2</asp:ListItem>
                <asp:ListItem Value="3">Test 3</asp:ListItem>
            </asp:RadioButtonList>
            <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
        </asp:Panel>




希望对您有帮助




Hope this helps


这篇关于ajax modelpop扩展程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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