We have to guess because you posted no code. My guess is you've set the button in question to be the okcontrolid. If so remove the okcontrolid, as that will inhibit the click event.
Did you assign OkButton as OKControl of ModalPopup?
If so, OkButton Click event can't be fired. You can use Client side code to close the ModalPopup, instead of assigning OKControl property. So you can use JavaScript $find('ModalPopupBehavior').hide() to close it in OnClientClick event of the button.
Actually i am working image croping tool.
A Image when uloaded it will show in popup from where it should cut to a required size then save to he application.
on Modal Popup i have a button crop which is not firing when working with master page, while it is working without master page.
There are two popup control first one's id is "ppex" and second one is "pper" i have first popup's target control id as "popup" which is a server side div and this div contains button
"btnCrop" whose click event not get fired.
I don't want to talk about Button1 which is in another div "erdiv".
Good Luck
Do FEAR (Face Everything And Rise)
Please mark as Answer if my post helps you..!
NadeemZee
Participant
942 Points
178 Posts
Modal PopUp Extender Button evevt not fired
Dec 19, 2012 03:43 AM|LINK
Hi All,
I have a master page and a client page on client page i have button from which the popup show.
The Modal Popup shows but when i click on the button on popup, the button click event not fired.
Any one can give me solution what to do for the button event get fired.
This is working when work without master page.
Do FEAR (Face Everything And Rise)
Please mark as Answer if my post helps you..!
MetalAsp.Net
All-Star
112241 Points
18268 Posts
Moderator
Re: Modal PopUp Extender Button evevt not fired
Dec 19, 2012 04:04 AM|LINK
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: Modal PopUp Extender Button evevt not fired
Dec 20, 2012 03:38 AM|LINK
Did you assign OkButton as OKControl of ModalPopup?
If so, OkButton Click event can't be fired. You can use Client side code to close the ModalPopup, instead of assigning OKControl property. So you can use JavaScript $find('ModalPopupBehavior').hide() to close it in OnClientClick event of the button.
http://forums.asp.net/t/1573821.aspx/1
http://forums.asp.net/p/1307377/2573517.aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
NadeemZee
Participant
942 Points
178 Posts
Re: Modal PopUp Extender Button evevt not fired
Dec 20, 2012 04:19 AM|LINK
Actually i am working image croping tool.
A Image when uloaded it will show in popup from where it should cut to a required size then save to he application.
on Modal Popup i have a button crop which is not firing when working with master page, while it is working without master page.
===================Master Page .Aspx <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> <!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> <asp:ContentPlaceHolder id="head" runat="server"> </asp:ContentPlaceHolder> </head> <body> <form id="form1" runat="server"> <div> <div style="background-color:Orange; height:50px;" align="center"><h1> Master Page Div</h1></div> <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </form> </body> </html> =======================content page aspx <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="nad" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <script src="JQuery/jquery.min.js" type="text/javascript"></script> <script src="JQuery/jquery.Jcrop.js" type="text/javascript"></script> <link href="CSS/style.css" rel="stylesheet" type="text/css" /> <link href="CSS/jquery.Jcrop.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> $(window).load(function () { var jcrop_api; var i, ac; initJcrop(); function initJcrop() { // var originalImgHeight = jQuery('#imgCropped').height(); var originalImgWidth = jQuery('#<%=imgCropped.ClientID %>').width(); var orginalHeight = ((originalImgWidth * 1) / 1); jcrop_api = $.Jcrop('#<%=imgCropped.ClientID %>', { onSelect: storeCoords, onChange: storeCoords }); //jcrop_api.setOptions({ aspectRatio: 1 / 1 }); jcrop_api.setOptions({ minSize: [450, 450], //maxSize: [originalImgWidth, orginalHeight] maxSize: [450, 450] }); //jcrop_api.setSelect([0, 0, originalImgWidth, orginalHeight]); jcrop_api.setSelect([0, 0, 450, 450]); }; function storeCoords(c) { jQuery('#<%=X.ClientID %>').val(c.x); jQuery('#<%=Y.ClientID %>').val(c.y); jQuery('#<%=W.ClientID %>').val(c.w); jQuery('#<%=H.ClientID %>').val(c.h); }; }); </script> <script type="text/javascript"> function fnClickDoPostBack(sender, e) { __doPostBack(sender, e); } </script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <div> <asp:FileUpload ID="fileupload1" runat="server" /><br /> <asp:Button ID="btn" runat="server" OnClick="btn_Click" Text="Show Image" /> </div> <asp:UpdatePanel ID="upd" runat="server"><ContentTemplate> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <nad:ModalPopupExtender ID="ppex" runat="server" TargetControlID="popup" PopupControlID="popup" OkControlID="popup" OnOkScript="__doPostBack('<%=btnCrop.ClientID %>','')" BackgroundCssClass="modalBackground" ></nad:ModalPopupExtender> <nad:ModalPopupExtender ID="pper" runat="server" TargetControlID="erdiv" PopupControlID="erdiv" CancelControlID="erdiv" BackgroundCssClass="modalBackground"></nad:ModalPopupExtender> <div id="popup" style="float:right; display:none;" align="center" class="modalPopup" runat="server"> <div class="divheader" runat="server" id="headerdiv"></div><br /> <asp:UpdatePanel ID="up" runat="server"> <ContentTemplate> <asp:Image ID="imgCropped" runat="server" /><br /> <asp:Button ID="btnCrop" OnClick="btnCrop_Click" runat="server" Text="Crop"/> </ContentTemplate> </asp:UpdatePanel> </div> <div id="erdiv" runat="server" align="center" class="modalPopup1" style="display:none;"> <div class="errdivheader" runat="server" id="Div1"></div><br /> <asp:Label ID="err" runat="server" Visible="true" ForeColor="Red"></asp:Label><br /><br /><br /> <asp:Button ID="Button1" runat="server" Text="OK" CssClass="btn" /> </div> </ContentTemplate></asp:UpdatePanel> <asp:Button ID="btntemp" runat="server" Visible="false" /> <asp:HiddenField ID="X" runat="server" /> <asp:HiddenField ID="Y" runat="server" /> <asp:HiddenField ID="W" runat="server" /> <asp:HiddenField ID="H" runat="server" /> <asp:HiddenField ID="hdn16W" runat="server" /> <asp:HiddenField ID="hdn16H" runat="server" /> </asp:Content> ===============Content Page aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Default3 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btn_Click(object sender, EventArgs e) { Session["ImageBytes"] = fileupload1.FileBytes; imgCropped.ImageUrl = "~/ImageHandler.ashx"; ppex.Show(); } protected void btnCrop_Click(object sender, EventArgs e) { } }Do FEAR (Face Everything And Rise)
Please mark as Answer if my post helps you..!
praptic
Member
61 Points
72 Posts
Re: Modal PopUp Extender Button evevt not fired
Dec 20, 2012 05:54 AM|LINK
NadeemZee
Participant
942 Points
178 Posts
Re: Modal PopUp Extender Button evevt not fired
Dec 20, 2012 06:11 AM|LINK
There are two popup control first one's id is "ppex" and second one is "pper" i have first popup's target control id as "popup" which is a server side div and this div contains button "btnCrop" whose click event not get fired.
I don't want to talk about Button1 which is in another div "erdiv".
Do FEAR (Face Everything And Rise)
Please mark as Answer if my post helps you..!
MetalAsp.Net
All-Star
112241 Points
18268 Posts
Moderator
Re: Modal PopUp Extender Button evevt not fired
Dec 20, 2012 11:44 AM|LINK