button click event in a AccordionPane control

Discussion in 'ASP .Net' started by Sinan Alkan, Sep 24, 2008.

  1. Sinan Alkan

    Sinan Alkan Guest

    Hi All,

    I have a button object in an AccordionPane on a "Web User Control" but i can
    not reach the click event of that button.
    The click event does not work.
    Here is my .ascx code ;
    ------------
    <cc1:Accordion ID="AccordionPane1" runat="server" FadeTransitions="True"
    SelectedIndex="0" TransitionDuration="300" HeaderCssClass="accordionHeader"
    ContentCssClass="accordionContent" RequireOpenedPane="false">
    <Panes>
    <cc1:AccordionPane runat="server" ID="Price_Range">
    <Header>For Price Filtering</Header>
    <Content>
    $<asp:TextBox ID="txtStart" runat="server"></asp:TextBox> to
    $<asp:TextBox ID="txtEnd" runat="server"></asp:TextBox>
    <asp:Button ID="btnSendPriceRange" runat="server" Text="GO"
    OnClick="btnSendPriceRange_Click" />
    </Content>
    </cc1:AccordionPane>
    </Panes>
    </cc1:Accordion>

    ------------
    And the code for the .cs file
    ------------
    void btnSendPriceRange_Click(object sender, EventArgs e)
    {
    //do something
    }
    ------------
    i can not reach the btnSendPriceRange_Click event ..

    when i click that button, it just refreshes the all page.

    Any assistance that anyone could provide would be most appreciated.


    Thanks in advance.


    Sinan ALKAN
     
    Sinan Alkan, Sep 24, 2008
    #1
    1. Advertising

  2. Try to wire it up in the page's oninit event instead. I've often found that
    there are cases when buttons are in certain containers that the onclick
    events don't get wired up properly because they are in a container. You may
    also want to check the forums for the asp.net ajax toolkit over at
    www.asp.net because I think this is a known issue if I remember correctly. I
    believe I solved my problems by wiring it up in code-behind in the init
    event.

    Hope this helps,
    Mark Fitzpatrick
    Microsoft MVP - Expression

    "Sinan Alkan" <> wrote in message
    news:eDu#...
    > Hi All,
    >
    > I have a button object in an AccordionPane on a "Web User Control" but i
    > can not reach the click event of that button.
    > The click event does not work.
    > Here is my .ascx code ;
    > ------------
    > <cc1:Accordion ID="AccordionPane1" runat="server" FadeTransitions="True"
    > SelectedIndex="0" TransitionDuration="300"
    > HeaderCssClass="accordionHeader"
    > ContentCssClass="accordionContent" RequireOpenedPane="false">
    > <Panes>
    > <cc1:AccordionPane runat="server" ID="Price_Range">
    > <Header>For Price Filtering</Header>
    > <Content>
    > $<asp:TextBox ID="txtStart" runat="server"></asp:TextBox> to
    > $<asp:TextBox ID="txtEnd" runat="server"></asp:TextBox>
    > <asp:Button ID="btnSendPriceRange" runat="server" Text="GO"
    > OnClick="btnSendPriceRange_Click" />
    > </Content>
    > </cc1:AccordionPane>
    > </Panes>
    > </cc1:Accordion>
    >
    > ------------
    > And the code for the .cs file
    > ------------
    > void btnSendPriceRange_Click(object sender, EventArgs e)
    > {
    > //do something
    > }
    > ------------
    > i can not reach the btnSendPriceRange_Click event ..
    >
    > when i click that button, it just refreshes the all page.
    >
    > Any assistance that anyone could provide would be most appreciated.
    >
    >
    > Thanks in advance.
    >
    >
    > Sinan ALKAN
    >
    >
    >
    >
    >
     
    Mark Fitzpatrick, Sep 24, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Purvi T
    Replies:
    0
    Views:
    881
    Purvi T
    Oct 19, 2004
  2. Amy
    Replies:
    0
    Views:
    1,011
  3. Kursat

    Ajax AccordionPane problem

    Kursat, May 9, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    391
    Kursat
    May 9, 2007
  4. Max2006
    Replies:
    2
    Views:
    1,596
    Walter Wang [MSFT]
    Sep 19, 2007
  5. Replies:
    2
    Views:
    679
    David
    Apr 30, 2008
Loading...

Share This Page