Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Event under asp.net ajax control Model pop up extender is not firing, plz give me the solution
Posted
Comments
Mahendra.p25 3-May-11 2:12am    
which event. Please elaborate or post your code
Sandeep Mewara 3-May-11 2:32am    
And how do we guess what and how you are doing it?
Ankur\m/ 3-May-11 3:35am    
You plz please give us more details.
Sunasara Imdadhusen 3-May-11 5:28am    
Not clear!!!
bbirajdar 14-May-12 12:58pm    
Not firing? It must have run out of the bullets.. ;) .. How can somebody help you if you dont show them the code.. ? Are you really a programmer ?


Please be a little bit more descriptive about your question
Anyways, I am assuming the below scenarios

1. You click a button on the .aspx page but the modal popup is now shown
2. You have a button inside the panel which is shown when modal popup is active and that button when clicked does not fire the event.

Solution for point 1

ASPX Page:
//Normal Button
<asp:button runat="server" id="btnClickMe" text="Click Me" xmlns:asp="#unknown">
<asp:button runat="server" id="btnDummyClickMe" text="Click Me" style="display:none;" xmlns:asp="#unknown">

<cc1:modalpopupextender  runat="server" id="mpeShow" popupcontrolid="pnlPopup" targetcontrolid="btnDummyClickMe" ...="" xmlns:cc1="#unknown">

Code Behind Page
//Normal Button Click
protected void btnClickMe_Click(object sender, EventArgs e)
{
//do whatever operations you want to do
this.mpeShow.Show();
}

This will show the modal popup when click on the button named: Click Me

Solution for point 2
It generally happens that when you click a button inside the modal popup panel, the event is fired but the popup disappears.
Say for example, in the modal popup shown, you have two textboxes and a button. When you click that button, value from the first text box needs to be copied over to second text box.
For this purpose, it is the same code as
this.TextBox2.Text = this.Textbox1.Text; 

But, along with this, you need to include the line as:
this.mpeShow.Show();

So the steps would be in the button click of a button inside the pop up panel:
//show the pop up
//type something in text box
//click the button
//do whatever operation you like to do
//show the popup again


Hope this helps. If you have any other questions in mind, or you think I understand the question differently, please let me know and I can explain better.

-Nayan
Coding is an earthly heaven

 
Share this answer
 
v2
XML
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:Button ID="Btnshow" runat="server" Text="Show" OnClick="Btnshow_Click" />
        <asp:Button ID="BtnTarget" runat="server" Text="Target" Style="display: none" />
        <asp:TextBox ID="TextBox1" runat="server">
        </asp:TextBox>
        <input type="button" value="Get" onclick="abc()" />
        <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="BtnTarget"
            PopupControlID="Panel1">
        </asp:ModalPopupExtender>
        <asp:Panel ID="Panel1" runat="server" BackColor="Black" Width="300px" Height="300px">
            <asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:Button ID="BtnHide" runat="server" Text="Hide Button" OnClick="BtnHide_Click" />
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="BtnHide" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
        </asp:Panel>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="Btnshow" EventName="Click" />
    </Triggers>
</asp:UpdatePanel>



C#
protected void Btnshow_Click(object sender, EventArgs e)
  {
      ModalPopupExtender1.Show();
  }
  protected void BtnHide_Click(object sender, EventArgs e)
  {
      ModalPopupExtender1.Hide();
  }
 
Share this answer
 
v2
Comments
Sandeep Mewara 14-May-12 13:18pm    
Care to elaborate a little about the code you posted?

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