Solved

Modalpopupextender Control

Posted on 2013-01-05
2
228 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
Comment Utility
<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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now