Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi, I am lakshman rao. my web page contains modal popup, i write the code like this
ASP.NET
<asp:ImageButton ID="ImageButton2" runat="server" onclick="ImageButton2_Click" 
            style="position:absolute; top: 175px; left: 523px;" 
            ImageUrl="~/pics/programs.jpg" />

<asp:Panel ID="pnlprog" runat="server" BackImageUrl="~/pics/programs pop.jpg" Width="800px" Height="500" 
                    HorizontalAlign="NotSet" style="display:none; padding=0px;" BorderColor="Black" BorderStyle="None" BorderWidth="1px">

<asp:LinkButton ID="blk" runat="server" Text="* Balakuteer (Orphanage)" OnClick="blk_click" style="position:absolute; top:90px; left:590px;" Font-Size="Medium" ForeColor="#69A4B0" Font-Underline="False" Font-Bold="True"></asp:LinkButton> 
</asp:Panel> 

<ajaxtoolkit:ModalPopupExtender ID="mdlPopupProg" BehaviorID="mdlPopupProg"  runat="server" TargetControlID="ImageButton2" PopupControlID="pnlprog" OkControlID="hlprog" BackgroundCssClass="modalBackground" />
 <mb:ModalPopupAnimationExtender ID="ModalPopupAnimationExtender2" 
     runat="server" ModalPopupBehaviorID="mdlPopupProg" TargetControlID="pnlprog">
   <Animations>
      <OnShown>
         <FadeIn Duration="1.5" Fps="20" />		        
      </OnShown>
   </Animations>
 </mb:ModalPopupAnimationExtender>


This is the code used, but Here when i am trying to click the Linkbutton in that modalpopup it closes the the modalpopup, How to fire event args in modalpopup. i want when i clink the Linkbutton what ever the code in the blk_click is to be execute. can any one guide me in this...
Posted

see this format

C#
<cc1:modalpopupextender runat="server" id="mpeUserAccount1" targetcontrolid="btnUserAccount1" popupcontrolid="pnlUserAccount1" backgroundcssclass="modalBackground" behaviorid="mpeUserAccount1" xmlns:cc1="#unknown">
        </cc1:modalpopupextender>
  <asp:button runat="server" id="btnUserAccount1" style="display: none" xmlns:asp="#unknown" />        <asp:panel runat="server" cssclass="modalPopup" id="pnlUserAccount1" style="display: none;" xmlns:asp="#unknown">
            Width="40%" Height="40%" BackColor="White">
            <uc1:useraccount runat="server" id="ucUserAccount1" xmlns:uc1="#unknown" />
        </asp:panel>


give credit if this will help you
thanks
 
Share this answer
 
Comments
Tech Code Freak 8-Feb-12 12:38pm    
5up!
first add new button and set it TargetControlID

XML
<asp:ImageButton ID="ImageButton2" runat="server" onclick="ImageButton2_Click"
            style="position:absolute; top: 175px; left: 523px;"
            ImageUrl="~/pics/programs.jpg" />

<asp:Panel ID="pnlprog" runat="server" BackImageUrl="~/pics/programs pop.jpg" Width="800px" Height="500"
                    HorizontalAlign="NotSet" style="display:none; padding=0px;" BorderColor="Black" BorderStyle="None" BorderWidth="1px">

<asp:LinkButton ID="blk" runat="server" Text="* Balakuteer (Orphanage)" OnClick="blk_click" style="position:absolute; top:90px; left:590px;" Font-Size="Medium" ForeColor="#69A4B0" Font-Underline="False" Font-Bold="True"></asp:LinkButton>
</asp:Panel>
   <asp:button runat="server" id="btnShowModalPopup" style="display: none" xmlns:asp="#unknown" />
<ajaxtoolkit:ModalPopupExtender ID="mdlPopupProg" BehaviorID="mdlPopupProg"  runat="server" TargetControlID="btnShowModalPopup" PopupControlID="pnlprog" OkControlID="hlprog" BackgroundCssClass="modalBackground" />
 <mb:ModalPopupAnimationExtender ID="ModalPopupAnimationExtender2"
     runat="server" ModalPopupBehaviorID="mdlPopupProg" TargetControlID="pnlprog">
   <Animations>
      <OnShown>
         <FadeIn Duration="1.5" Fps="20" />
      </OnShown>
   </Animations>
 </mb:ModalPopupAnimationExtender>


then

show ModalPopupExtender on server site:

write on click event of ImageButton2
C#
ModalPopupExtender1.Show();
 
Share this answer
 
Comments
Tech Code Freak 8-Feb-12 12:38pm    
5up!
Jitendra Parida - Jeetu 8-Feb-12 23:43pm    
thanks
lakshmanarao.vemula 9-Feb-12 13:12pm    
Thanks Jitendra
Create a dummy button with display:none property. In the modelpopup extender set targetcontrolid to that dummy button.
 
Share this answer
 
v2
Comments
Tech Code Freak 8-Feb-12 12:38pm    
5up!

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