开发者

Update panel Postback

I Have A web Page Having Two TextBox and Two Image Button on Image Button Click open the ModalPopupExtender having Grid inside the ModelPopExtender. mean Grid Pop open on image button CLick. Problem is That when i click the button It show ModelPopExtender and Close. auto and Page Post Back and Again Pop open. I want that pop is open stage not to post back.

aspx Code is like: "

                                    <asp:ImageButton ID="imgbtnExpenseGL" runat="server" ImageUrl="../../Images/icon_popup.gif" ImageAlign="Top" OnClientClick="ShowPopupExpGLSearch();" />

                                     <AjaxToolKit:AutoCompleteExtender 
                                                ID="AutoCompleteExtender1" 
                                                runat="server" 
                                                CompletionInterval="100" 
                                                CompletionSetCount="12" 
                                                EnableCaching="false" 
                                                MinimumPrefixLength="1" 
                                                ServiceMethod="GetGLAccountList" 
                                                TargetControlID="txtExpenseGL"
                                                >
                                    </AjaxToolKit:AutoCompleteExtender>

                                    <AjaxToolKit:ModalPopupExtender 
                                                ID="ModalPopupExtender1" 
                                                runat="server" 
                                                BackgroundCssClass="modalBackground" 
                                                CancelControlID="btnCancelCountry"
                                                DropShadow="true" 
                                                PopupControlID="divExpenseGLSearch"
                                                TargetControlID="imgbtnExpenseGL">
                                  </AjaxToolKit:ModalPopupExtender>
                                    </ContentTemplate>
                                    </asp:UpdatePanel>"

Thier two update panel like that having same code.

and This Grid Bind div Code:

                        <div id="divAccountGLSearch" class="popup" style="display: none; width: 350px;">
                            <table width="98%" align="center" border="0" cellpadding="0" cellspacing="0" style="height: 320px;">
                               <%-- For Heading and Image and CloseDiv --%>
                               <%-- Row 1 For Header Text --%>
                                <tr>
                                    <th>
                                    <h1>
                                      List of Pre-Paid Account GL
                                    </h1>

                                    </th>
                                    <td align="right" valign="top" style="padding-top: 6px;">
                                        <img onclick="CloseDiv();" src="../../Images/close.gif" border="0" />
                                </tr>
                               <%-- Row 2 For Find TextBox and Find Button  --%>
                                <tr>
                                        <td class="form-label" style="padding-left: 5px;width:70%;">
                                            Search&nbsp;&nbsp;
                                            <asp:TextBox ID="txtFindPrePaidExpenses" runat="server" onBlur="javascript:setpopupfocus();" ></asp:TextBox>&nbsp;&nbsp;                                                        
                                            </td>
                                        <td align="left" style="width:30%;">
                                            <table>
                                            <tr>
                                            <td>
                                            <asp:LinkButton ID="btnFindCountry" CssClass="button" runat="server" 
                                                    OnClientClick="ShowPopupAccGLSearch();" onclick="btnFindCountry_Click">
                                            <span>Find</span></asp:LinkButton>
                                            </td>
                                            </tr>
                     开发者_JS百科                       </table>                                                         
                                        </td>
                                 </tr> 
                               <%-- Row 3 For Repater Control  --%>
                                <tr>
                                        <td colspan="2" align="center">
                                        <div style="overflow: auto; height: 280px; width: 100%;">
                                        <asp:GridView ID="gvSearchAccountGL" runat="server" AutoGenerateColumns="False" 
                                                Width="98%" CssClass="table-grid" border="0" CellPadding="0" 
                                                CellSpacing="0" onrowdatabound="gvSearchAccountGL_RowDataBound"  
                                                >

                                            <Columns>
                                                     <asp:TemplateField Visible="false">
                                                            <ItemTemplate>
                                                                <asp:HiddenField ID="hfIndex" runat="server" Value='<%# Container.DataItemIndex + 1 %>'/>
                                                            </ItemTemplate>
                                                            <HeaderStyle HorizontalAlign="left" />
                                                            <ItemStyle HorizontalAlign="left" />
                                                     </asp:TemplateField>
                                                     <asp:TemplateField HeaderText="Account GL">
                                                        <ItemTemplate>
                                                              <asp:Label ID="lblAccountGLCode"  runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ACM_ACCOUNT_CODE")%>' ></asp:Label>
                                                        </ItemTemplate>
                                                        <HeaderStyle HorizontalAlign="left" />
                                                        <ItemStyle HorizontalAlign="left" />
                                                    </asp:TemplateField> 
                                                    <asp:TemplateField HeaderText="Account Description">
                                                        <ItemTemplate>
                                                              <asp:Label ID="lblAccountGLDescription"  runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ACM_ACCOUNT_DESC")%>' ></asp:Label>
                                                        </ItemTemplate>
                                                        <HeaderStyle HorizontalAlign="left" />
                                                        <ItemStyle HorizontalAlign="left" />
                                                    </asp:TemplateField> 
                                            </Columns>
                                            <RowStyle CssClass="gridRow" />
                                            <HeaderStyle CssClass="gridHeader" />
                                            <SelectedRowStyle BackColor ="Gray" />
                                        </asp:GridView> 
                                        </div>
                                        </td>
                                   </tr>
                               <%-- Row 4 For Space Image  --%>
                                <tr>
                                        <td colspan="2">
                                            <img src="../../Images/spacer.gif" border="0" class="seprator" />
                                        </td>
                                    </tr>
                               <%-- Row 5 For OK and Cancel Button --%>
                                <tr>
                                        <td colspan="2">
                                            <table border="0" cellpadding="0" cellspacing="0" align="center">
                                                <tr>                                                                       
                                                    <td>
                                                        <asp:LinkButton ID="btnOKPrePaidExpense" CssClass="button" runat="server" 
                                                            onclick="btnOKPrePaidExpense_Click">
                                                        <span>OK</span></asp:LinkButton>
                                                        </td>
                                                    <td>
                                                            &nbsp;
                                                        </td>
                                                        <td>
                                                        <asp:LinkButton ID="btnCancelPrePaidExpense" CssClass="button" runat="server">
                                                        <span>Cancel</span></asp:LinkButton>                                                                    
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                            </table>
                        </div>

My div Bind Code is Out off Update Panel Code.

so how to stop postback and Stable Pop Control

Thank U


To prevent the ImageButton control from automatically posting back when it's clicked, your ShowPopupExpGLSearch() function should return false.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜