Click here to Skip to main content
12,943,299 members (79,228 online)

model pop up extender problem

srinvas asked:

Open original thread
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)

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

<cc1:ModalPopupExtender runat="server" ID="mpc1"

BackgroundCssClass="modalBackground" >

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


<asp:TextBox ID="txtPost" TextMode="MultiLine" runat="server" onkeypress="javascript:LimitText(txtPost,500);"
Height="140px" Width="700px">

<%--<cc1:TextBoxWatermarkExtender ID="txboxwatmrk_post" TargetControlID="txtPost" WatermarkCssClass="watermark" WatermarkText="Write a post...!!" runat="server">--%>
<asp:RequiredFieldValidator ID="reqtxtPost" ValidationGroup="vgroup" runat="server" ControlToValidate="txtPost" ErrorMessage="Please enter a post" BackColor="#F0F8FF">
<input type="text"
id="pnlCC_tbCountdown" value="" name="pnlCC_tbCountdown" style="border:0px;padding-bottom:10px;color:Red;background-color:#F0F8FF;"
readonly="readonly" />

<asp:FileUpload ID="fp1" runat="server" />
<asp:RegularExpressionValidator ID="FileUpLoadValidator1" runat="server" ErrorMessage="Attach Only doc,docx,pdf,xls,xlsx files!" ValidationExpression=".*(.doc|.docx|.pdf|.xls|.xlsx)$" ControlToValidate="fp1" Display="Dynamic">

<asp:FileUpload ID="fp2" runat="server" />
<asp:RegularExpressionValidator ID="FileUpLoadValidator2" runat="server" ErrorMessage="Attach Only doc,docx,pdf,xls,xlsx files!" ValidationExpression=".*(.doc|.docx|.pdf|.xls|.xlsx)$" ControlToValidate="fp2" Display="Dynamic">

<asp:ImageButton ID="btnShare" ImageUrl="Images/share.jpg" CssClass="sharebutton" ValidationGroup="vgroup" OnClick="btnShare_Click" runat="server"/>
<asp:ImageButton ID="btncancel" ImageUrl="~/Saibook/Images/CancelButtonUp1.gif" CssClass="sharebutton" runat="server" CausesValidation="false"/>

<%--<asp:ImageButton ID="ImageButton2" ImageUrl="Images/share.jpg" CssClass="sharebutton" OnClick="btnShare2_Click" OnClientClick = "Confirm()" runat="server" />--%>

please reply

Tags: C#, ASP.NET, Ajax


When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).

Advertise | Privacy | Mobile
Web02 | 2.8.170518.1 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2017
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