2010-09-17 86 views
4

我在我的项目中使用ajax colllapsible面板扩展。因此,在价格范围功能面板中,我有两个文本框和一个处理价格范围功能的asp按钮。嗯,我试图设置按钮作为默认按钮,该面板内,但它不工作。我在Firefox中尝试过我的页面,IE & Chrome也。它只是不执行任何操作并重新加载页面。asp面板默认按钮不工作

下面我加入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> 

如果任何人可以帮助我在此。

感谢&问候,

MEHUL Makwana。

+0

检查javascript错误。 (并更新到此控件的最新版本) – Aristos 2010-09-17 09:58:52

+0

嗨aristos我通过Dumitru的帮助解决了问题。感谢Aristos。哪个是最新版本。 – mehul9595 2010-09-17 10:38:34

回答

2

尝试从txtPriceTo文本框中删除AutoPostBack="True",看看是否有帮助。

+0

Heyy超级伙计,这是唯一的问题。谢谢你的帮助。你可以告诉我,当它被设置为真时问题是什么?这样我就不会再犯同样的错误了。 – mehul9595 2010-09-17 10:36:30

+0

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.autopostback.aspx - “如果在TextBox控件失去焦点时发生自动回发,则为true”。可能它会在默认按钮的事件被调用之前执行自动回发。 – 2010-09-17 10:40:00

+0

ohhkk感谢您的帮助 – mehul9595 2010-09-17 10:43:54