Click here to Skip to main content
15,891,883 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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" />




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,
Posted
Comments
_Tushar Patil 23-Nov-11 0:00am    
Is your Popup Closing After Selecting RadioButtonList item...?

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
 
Share this answer
 
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>
 
Share this answer
 
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.

XML
<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
 
Share this answer
 
you don't have to call the modal pop up since you fill the target control.
hope it helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900