首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >ASP.NET webforms应用程序中的Ajax模式弹出扩展

ASP.NET webforms应用程序中的Ajax模式弹出扩展
EN

Stack Overflow用户
提问于 2020-12-23 13:28:28
回答 1查看 42关注 0票数 0

我的ASP.NET webforms应用程序中有模态弹出窗口扩展器。我可以在所有all表单中重用相同的模式弹出窗口扩展器来完成通用搜索吗?

如果可能,我可以把模式弹出窗口扩展器放在哪里?有谁能帮帮我

代码语言:javascript
运行
复制
 <asp:UpdatePanel ID="UpdatePanel3" runat="server">
        <ContentTemplate>
            <asp:Button runat="server" ID="btnTarget" Style="display: none;" />
            <cc1:ModalPopupExtender runat="server" ID="mp1" PopupControlID="SearchPanel" TargetControlID="btnTarget"
                CancelControlID="ImgBtnCloseSearch" BackgroundCssClass="modalBackground">
            </cc1:ModalPopupExtender>

            <asp:Panel runat="server" ID="PanelSearch" OnLoad="PanelSearch_Load">
                <div id="SearchPanel" runat="server" class="modalPopup">
                    <asp:ImageButton runat="server" ImageUrl="~/Images/CloseButton.png" ID="ImgBtnCloseSearch" CssClass="Modal-Close" />
                    <div class="row">
                        <div style="margin-left: auto; margin-right: auto; text-align: center; margin-top: 12px;">
                            <asp:Label runat="server" Text="Search Text" ID="lblKey" Style="margin-left: 5px;"></asp:Label>
                            <asp:TextBox runat="server" ID="txtKey" Style="margin-left: 5px;" Width="200" Height="25"></asp:TextBox>
                            <asp:Button Text="Go" runat="server" CssClass="Btn-Go" ID="BtnGoSearch" OnClick="BtnGoSearch_Click" Height="26" />
                            <br />
                            <div class="Div-DisplaySearchGrid">
                                <asp:GridView ID="GrdDataSearch" runat="server" AutoGenerateColumns="false" OnRowDataBound="GrdDataSearch_RowDataBound"
                                    Font-Size="11px" HeaderStyle-BackColor="#c8c8c8" FooterStyle-BackColor="#f0f1f3" BackColor="whitesmoke"
                                    DataKeyNames="PK" BorderColor="black" CellPadding="3" ShowFooter="True" ShowHeaderWhenEmpty="true">
                                </asp:GridView>
                                <%--   <asp:GridView ID="GvSearchData" runat="server" ShowHeaderWhenEmpty="true" AllowSorting="true" AllowPaging="True" AutoGenerateColumns="False" Font-Size="11px" HeaderStyle-BackColor="#c8c8c8" FooterStyle-BackColor="#f0f1f3" BackColor="whitesmoke" DataKeyNames="PK" BorderColor="black"
                                    EmptyDataText="No rows to display"
                                    CellPadding="3" ShowFooter="True" PageSize="10" OnPageIndexChanging="GvSearchData_PageIndexChanging" OnRowDataBound="GvSearchData_RowDataBound" OnSelectedIndexChanged="GvSearchData_SelectedIndexChanged" Style="margin-bottom: 20px; margin-top: 10px; margin-left: 2px; margin-right: 2px;">
                                    <Columns>
                                        <asp:BoundField DataField="Id" HeaderText="Id" HeaderStyle-Width="40" Visible="false" />
                                        <asp:BoundField DataField="Code" HeaderText="Code" HeaderStyle-Width="120" />
                                        <asp:BoundField DataField="Description" HeaderText="Description" HeaderStyle-Width="280" />
                                        <asp:BoundField DataField="Category" HeaderText="Category" HeaderStyle-Width="200" />
                                        <asp:BoundField DataField="SubCategory" HeaderText="SubCategory" HeaderStyle-Width="200" />
                                    </Columns>
                                </asp:GridView>--%>
                            </div>
                            <br />

                        </div>
                        <asp:HiddenField runat="server" ID="hdnSearchFlag" />
                       
                    </div>
                </div>
        </asp:Panel>
    </ContentTemplate>
</asp:UpdatePanel>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-24 06:18:28

您可以尝试将其添加为用户控件,然后在需要的页面上声明该控件。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65419444

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档