一秒钟内ASP.net Disappers中的AJAX弹出窗口(弹出面板) [英] AJAX popup (popuping panel)in ASP.net Disappers in a sec

查看:62
本文介绍了一秒钟内ASP.net Disappers中的AJAX弹出窗口(弹出面板)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASP.net中使用AJAX弹出窗口(弹出面板)我正在调用该面板弹出窗口来插入和更新数据。对于插入我在插入后按钮btnShowPopup中调用弹出窗口它将添加到网格中,如果我再次单击网格中的行,则应该通过网格grdTimeSheetEntry打开相同的弹出窗口。更新。

问题是弹出来并在一秒内消失(从服务器重定向后)但在弹出窗口内收到所有值。如何显示弹出标准也无法使用更新面板

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

<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>

推荐答案

尝试为您的面板声明style =display:none pnlPopup



看看它是否有效。



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

See if it works.

<asp:panel id="pnlPopup" borderstyle="Solid" style="display: none" runat="server"></asp:panel>


如果您在更新面板中使用所有AJAX弹出代码,问题就解决了。





如果解决问题,请接受答案
if u take all AJAX popup code with in the Update Panel your problem is solve.


Accept as answer if solve you problem.


try this one



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

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

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


            </ContentTemplate>
        </asp:UpdatePanel>
 </form>


这篇关于一秒钟内ASP.net Disappers中的AJAX弹出窗口(弹出面板)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆