asp.net - asp面板默认按钮不起作用

标签 asp.net panel

我在我的项目中使用 ajax 可折叠面板扩展器。因此,在其中一个价格范围功能面板中,我有 2 个文本框和一个用于处理价格范围功能的 asp 按钮。好吧,我正在尝试将按钮设置为该 asp 面板内的默认按钮,但它不起作用。我也在 Firefox、IE 和 chrome 中尝试了我的页面。它只是不执行任何操作并重新加载页面。

下面我添加了asp代码,

<asp:Panel ID="PricePanel" runat="server" CssClass="ui-widget-header ui-corner-all"
                                Style="padding: 0.1em 0.3em; text-align: left;">
                                <asp:Image ID="imgPrice" runat="server" />
                                <asp:Label ID="AllPrices" runat="server" Text="Price Range"></asp:Label>
                            </asp:Panel>
                            <asp:Panel ID="PricePanelContent" runat="server" CssClass="collapsePanel" DefaultButton="btnPrice">
                                <div class="PriceRange">
                                    <asp:Label ID="lblPriceFrom" runat="server" Text="Rs" Width="20px"></asp:Label><asp:TextBox
                                        Width="60px" ID="txtPriceFrom" runat="server"></asp:TextBox>
                                    <asp:Label ID="lblPriceTo" runat="server" Text="To Rs " Width="42px"></asp:Label><asp:TextBox
                                        ID="txtPriceTo" Width="60px" runat="server" AutoPostBack="True" Wrap="True"></asp:TextBox>
                                    <asp:Button ID="btnPrice" runat="server" Text="Go" OnClick="btnPrice_Click" />
                                </div>
                            </asp:Panel>
                            <asp:CollapsiblePanelExtender TargetControlID="PricePanelContent" ImageControlID="imgPrice"
                                ExpandedImage="~/images/open.png" CollapsedImage="~/images/close.png" ID="CollapsiblePrice"
                                ExpandControlID="PricePanel" CollapseControlID="PricePanel" CollapsedText="All Price"
                                TextLabelID="AllPrices" ExpandedText="" Collapsed="true" runat="server" SuppressPostBack="true">
                            </asp:CollapsiblePanelExtender>

如果有人可以帮助我。

感谢和问候,

梅胡尔·马克瓦纳。

最佳答案

尝试删除 AutoPostBack="True"来自您的 txtPriceTo文本框,看看是否有帮助。

关于asp.net - asp面板默认按钮不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3734313/

相关文章:

java - Swing:面板尺寸问题

c# - 动态添加控件和事件处理程序 C#

asp.net - 如何在 Asp.Net 中使用 CSS 创建多列数据输入表单?

c# - 在 ASP.NET Core 2.0 中找不到 AddJsonOptions

java - 当鼠标悬停在两个面板的交叉区域时更改光标

c# - 禁用面板上的特定控件

c# - 在换行面板中设置最大行数

c# - 我们可以在 C# 文件中使用在 .asp 文件中创建的类吗

javascript - 从一个 JavaScript 函数调用另一个具有 return false 的 JavaScript 函数;?

asp.net - 从命令行构建 ASP.NET 解决方案?