Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm using the AJAX popup (popuping panel)in ASP.net i'm calling that panel popup for inserting and updating data. for insert i had call popup in button btnShowPopup after insert it will added to the grid if i click the row in grid again the same popup should be open by grid grdTimeSheetEntry. for update.
The problem is popup come and disappears in a sec(after redirect from server) but inside the popup all values received. how to show the popup standard also unable to use update panel
C#
<form id="form1" runat="server">



 <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
 </asp:ToolkitScriptManager>

     <div style="float: right;">
         <asp:Button ID="btnShowPopup" Text="Add Entry" runat="server"
             onclick="btnShowPopup_Click" />
     </div>

     <div>
     <asp:GridView ID="grdTimeSheetEntry" runat="server" BackColor="White" BorderColor="#3366CC"
         BorderStyle="None" BorderWidth="1px" CellPadding="4" Width="100%"
             AllowPaging="True" onpageindexchanging="grdTimeSheetEntry_PageIndexChanging"
             PageSize="15" onrowcommand="grdTimeSheetEntry_RowCommand"

             AutoGenerateColumns="False" AutoGenerateSelectButton="false"
             onrowdatabound="grdTimeSheetEntry_RowDataBound"
             onselectedindexchanged="grdTimeSheetEntry_SelectedIndexChanged">
         <RowStyle BackColor="White" ForeColor="#003399" />
         <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
         <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
         <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
         <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
         <Columns>

            <asp:CommandField Visible="false" />
            <asp:BoundField DataField="EntryTypeName" Visible="true" ></asp:BoundField>
            <asp:BoundField DataField="ProductName" Visible="true" ></asp:BoundField>
            <asp:BoundField DataField="VersionNumber" Visible="true" ></asp:BoundField>
            <asp:BoundField DataField="BugID" Visible="true" ></asp:BoundField>
            <asp:BoundField DataField="SupportID" Visible="true" ></asp:BoundField>
            <asp:BoundField DataField="Description" Visible="true" ></asp:BoundField>
            <asp:BoundField DataField="Date" Visible="true" ></asp:BoundField>
            <asp:BoundField DataField="Effort" Visible="true" ></asp:BoundField>
         </Columns>
     </asp:GridView>
 </div>

 <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnShowPopup" PopupControlID="pnlPopup" BackgroundCssClass="bkground" DropShadow="false" PopupDragHandleControlID="pnlPopup" CancelControlID="btncancel">
 </asp:ModalPopupExtender>


     <asp:ModalPopupExtender ID="ModalPopupExtender2"  runat="server" TargetControlID="grdTimeSheetEntry" PopupControlID="pnlPopup" BackgroundCssClass="bkground" DropShadow="false" PopupDragHandleControlID="pnlPopup" CancelControlID="btncancel">
     </asp:ModalPopupExtender>


  <asp:Panel ID="pnlPopup"  BorderStyle="Solid" runat="server">
     <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
     <ContentTemplate>--%>

         <div style="background-color:GrayText;">
             <table border="0">
                 <tr>
                     <td colspan="2" style="background-color:Maroon;color:White;font-weight:bold" > Time Sheet Entry </td>
                 </tr>
                 <tr>
                     <td><asp:Label ID="lblEtyID" Text="EntryID" runat="server" Visible="False"></asp:Label></td>
                     <td><asp:TextBox ID="txtEtyID" runat="server" Enabled="False" Visible="False"></asp:TextBox></td>
                 </tr>
                 <tr>
                     <td> <asp:Label ID="lbluserid" Text="UserID" runat="server" Visible="False"></asp:Label></td>
                      <td><asp:TextBox ID="txtUserID" runat="server" Enabled="False" Visible="False"></asp:TextBox></td>
                 </tr>
                 <tr>
                     <td><asp:Label ID="lbltypeid" Text="Type" runat="server"></asp:Label></td>
                     <td><asp:DropDownList ID="ddlTypeid" runat="server"></asp:DropDownList> </td>
                 </tr>
                 <tr>
                     <td><asp:Label ID="lblProID" Text="ProductName" runat="server"></asp:Label></td>
                     <td><asp:DropDownList ID="ddlproductid" runat="server" AutoPostBack="true"
                             onselectedindexchanged="ddlproductid_SelectedIndexChanged"></asp:DropDownList></td>
                 </tr>
                 <tr>
                      <td><asp:Label ID="lblverid" Text="VersionNumber" runat="server"></asp:Label></td>
                      <td><asp:DropDownList ID="ddlversionid" runat="server"></asp:DropDownList></td>
                 </tr>
                 <tr>
                      <td><asp:Label ID="lblbug" Text="BugID" runat="server"></asp:Label></td>
                      <td><asp:TextBox ID="txtBugid" runat="server"></asp:TextBox></td>
                 </tr>
                 <tr>
                       <td><asp:Label ID="lblsuppid" Text="SupportID" runat="server"></asp:Label></td>
                       <td><asp:TextBox ID="txtSupportid" runat="server"></asp:TextBox> </td>
                 </tr>
                 <tr>
                       <td><asp:Label ID="lblDescription" Text="Description" runat="server"></asp:Label></td>
                       <td><asp:TextBox ID="txtDescription" runat="server"></asp:TextBox></td>
                 </tr>
                 <tr>
                       <td><asp:Label ID="lbldate" Text="Date" runat="server"></asp:Label></td>
                       <td><asp:TextBox ID="txtDate" runat="server" Enabled="False"></asp:TextBox></td>
                 </tr>
                 <tr>
                       <td><asp:Label ID="lbleffort" Text="Effort" runat="server"></asp:Label></td>
                       <td><asp:TextBox ID="txtEffort" runat="server"></asp:TextBox></td>
                 </tr>

                 <tr >

                     <td ><asp:Button ID="btnSubmit" Text="SUBMIT" runat="server"
                             onclick="btnSubmit_Click" /></td>
                     <td><asp:Button ID="btncancel" Text="CANCEL" runat="server" AutoPostBack="true"
                             onclick="btncancel_Click"/>  </td>
                 </tr>

                       <tr>
                       <td colspan="2"></td>
                       </tr>
                 <tr>
                      <td colspan="2"><asp:Label ID="lblInsinfo" runat="server"></asp:Label> </td>
                 </tr>
             </table>
         </div>
     <%--</ContentTemplate>
     </asp:UpdatePanel>--%>
 </asp:Panel>


 </form>
Posted
Updated 9-Jul-13 2:27am
v3
Comments
Where have you written the code to open the Modal?

Try declaring style="display: none" for your panel pnlPopup.

See if it works.

ASP.NET
<asp:panel id="pnlPopup" borderstyle="Solid" style="display: none" runat="server"></asp:panel>
 
Share this answer
 
v2
Comments
kesav prakash 9-Jul-13 8:48am    
still a same problem
if u take all AJAX popup code with in the Update Panel your problem is solve.


Accept as answer if solve you problem.
 
Share this answer
 
v2
Comments
kesav prakash 9-Jul-13 8:28am    
ya i done but it dosen't works,

i mproved my question now
You don't need to post multiple answers.
Just update this answer by clicking on "Improve solution" link.
XML
try this one



<form id="form1" runat="server">

    <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>

                Here add ur code
            -----
            ----


            </ContentTemplate>
        </asp:UpdatePanel>
 </form>
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900