Solved

Modalpopupextender Control

Posted on 2013-01-05
2
230 Views
Last Modified: 2013-01-22
Hello,

I’m using the modalpopupextender control.
So far it’s working okay.  I can display it I then have a button within the panel that when clicked goes off and does some action.

Once the button is clicked the action is completed and the panel is hidden (I’m guessing because the page is reloaded).

I like to include a additional statement within the button code that based on a condition either completes actions, or updates the text of a label control within the panel.

So the question is how do I stop the panel from automatically closing?

TIA
0
Comment
Question by:andyw27
2 Comments
 
LVL 20

Expert Comment

by:informaniac
ID: 38746423
<asp:Button id="btn1" runat="server" OnClientClick="javascript:return BtnClick();" Text="Button"></asp:Button>

function BtnClick()
{
           if(chck condition if change label....)
           {
                        // Write code to change label text
                        return false;
            }
            else
            {
                     // write code to post back
                     return true;
            }
}

Open in new window

0
 
LVL 2

Accepted Solution

by:
harshada_sonawane earned 500 total points
ID: 38746571
try this:
protected void btn1_Click(object sender, EventArgs e)
    {
       if(condition1)
        {
          //change label
           popup.Show();
          }
    }

but panel sd not become visible false after post back
u can try this:

 <asp:Label ID="lblmsgpop" runat="server" Text=""> </asp:Label>
    <asp:ModalPopupExtender ID="PopEx" runat="server" BehaviorID="popmsg" TargetControlID="lblmsgpop"        PopupControlID="pnlPopup" />


<asp:Panel ID="pnlPopup" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>

your poup controls
  </ContentTemplate>
    </asp:UpdatePanel>
</asp:Panel>
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question