Click here to Skip to main content
15,902,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Experts,
When i try to use modalpopup extender in asp.net using VS 2008, I cannt able to show the popup, when the click button event runs the popup shows and goes off, i think auto event postback of button event makes me trouble, Below i have provided my code, kindly have an look and let me know where i went wrong
XML
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ModalPopUp.aspx.cs" Inherits="ModalPopUp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<! 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 id="Head1" runat="server">
<title></title>
<style type="text/css">
.modalBackground
{
background-color: Yellow;
filter: alpha(opacity=60);
opacity: 0.6;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div style="min-height: 700px; height: 307px;">
<asp:Button ID="Button1" runat="server" Text="Click here to show the modal" />
<asp:ModalPopupExtender ID="ModalPopupExtender1" BackgroundCssClass="modalBackground"
runat="server" CancelControlID="btnCancel" OkControlID="btnOkay"
TargetControlID="Button1" PopupControlID="Panel1" Drag="true"
PopupDragHandleControlID="PopupHeader">
</asp:ModalPopupExtender>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div id="Panel1" runat="server">
<div id="popup_Container" runat="server">
<div id="PopupHeader" runat="server">
<div id="TitlebarLeft" runat="server">Popup Header</div>
<div id="TitlebarRight" runat="server"></div>
</div>
<div id="popup_Body" runat="server">
<p>
This is a simple modal dialog
</p>
</div>
<div id="popup_Buttons" runat="server">
<input id="btnOkay" value="Done" runat="server" type="button" />
<input id="btnCancel" value="Cancel" type="button" runat="server" />
</div>
</div>
</div>
</div>
</form>
</body>
</html>


[Edited]removed normal texts from "Pre" tag[/Edited]
Posted
Updated 28-Jan-11 19:34pm
v3

1 solution

Assign the correct values to the properties of the ModalPopup and make sure all needed properties are defined.

Have a look at this simple article example and follow up: Similar logic based article[^]
 
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