Click here to Skip to main content
12,502,116 members (53,281 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET Ajax
hi have an application if i click post button it shows pop up extender with

textbox and buttons.


it shows popup extender only after i click the post button second time. why?first time it is not showing pop up.
below is the code.



protected void Page_Load(object sender, EventArgs e)
   {


if (!IsPostBack)
{
pnlMonthly_Goals.Visible = false;
}
}


protected void btnPost_OnClick(object sender, EventArgs e)
   {
    pnlMonthly_Goals.Visible=true;
   }

<asp:Button ID="btnPost" runat="server" Text="Post" OnClick="btnPost_OnClick" />

<cc1:ModalPopupExtender runat="server" ID="mpc1"
BehaviorID="modalPopupExtender1"
TargetControlID="btnPost"
PopupControlID="pnlMonthly_Goals"
CancelControlID="btncancel"

BackgroundCssClass="modalBackground" >

<asp:Panel ID="pnlMonthly_Goals" runat="server" >
<asp:UpdatePanel ID="upanel1" runat="server">






please reply

Thanks
Srinivas
Posted 21-Jan-13 13:33pm
srinvas689

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

ModalPopupExtender has to use a panel to display as the modal popup frame.
This code:
<asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
</asp:scriptmanager>
<asp:modalpopupextender cancelcontrolid="cancelLoginButton" id="loginModalPopuExtender" targetcontrolid="loginLinkButton" popupdraghandlecontrolid="PopupHeader" popupcontrolid="loginPanel" runat="server" xmlns:asp="#unknown">
</asp:modalpopupextender>
<asp:panel style="display:none;" runat="server" id="loginPanel" xmlns:asp="#unknown">
   <div>
      <div id="PopupHeader" class="modalPopup-header">Login</div>
         <table class="modalPopup-Content">
            <tr>
               <td style="width:50px;">
                  <asp:label id="Label1" runat="server" text="Email"></asp:label>
               </td>
               <td style="width:200px;">
                        <asp:textbox id="emailTextBox" style="width:200px;" runat="server"></asp:textbox>
               </td>
            </tr>
            <tr>
               <td>
                   <asp:label id="Label2" runat="server" text="Passwort"></asp:label>
                </td>
                <td>
                   <asp:textbox id="passwordTextBox" style="width:200px;" runat="server" textmode="Password"></asp:textbox>
                </td>
             </tr>
             <tr class="clear hideSkiplink">
                <td>
                   <asp:button id="cancelLoginButton" runat="server" text="Abbrechen" cssclass="modalPopup-button" />
                </td>
                <td style="text-align:right;">
                   <asp:button id="loginButton" runat="server" text="Login">
                            onclick="loginButton_Click" cssclass="modalPopup-button"/>

Looks like this on My Page[^]. To expand the popup, click on "Login" in the top right corner.
Feel free to view the page source, it might help you a bit...


cheers,
Marco Alessandro Bertschi
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160919.1 | Last Updated 23 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100