Solved

Modalpopupextender Control

Posted on 2013-01-05
2
231 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

807 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