tags:

views:

68

answers:

1

Hi All,

I am using ajax colllapsible panel extender in my project. So in one of the Price Range function panel i have 2 text boxes and one asp button that will handle the function of price range. Well i'm trying to set button as default button inside that asp panel but it does not work. I tried my page in firefox, IE & chrome also. It just performs no action and reloads the page.

Below i am adding the asp code,

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

If any one can help me on this.

Thanks & Regards,

Mehul Makwana.

+1  A: 

Try to remove the AutoPostBack="True" from your txtPriceTo text box, and see if that helps.

Dan Dumitru
Heyy superb dude that was the only problem. Thanks for your help. Can you please tell me what actually the problem was when it was set to true? so that i wont make this same mistake again.
mehul9595
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.autopostback.aspx - "true if an automatic postback occurs when the TextBox control loses focus". Probably it performed the automatic postback before your default button's event got called.
Dan Dumitru
ohhkk Thanks for help
mehul9595