button click event in a AccordionPane control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sinan Alkan

    button click event in a AccordionPane control

    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:Accordio n ID="AccordionPa ne1" runat="server" FadeTransitions ="True"
    SelectedIndex=" 0" TransitionDurat ion="300" HeaderCssClass= "accordionHeade r"
    ContentCssClass ="accordionCont ent" RequireOpenedPa ne="false">
    <Panes>
    <cc1:AccordionP ane 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="btnSendPric eRange" runat="server" Text="GO"
    OnClick="btnSen dPriceRange_Cli ck" />
    </Content>
    </cc1:AccordionPa ne>
    </Panes>
    </cc1:Accordion>

    ------------
    And the code for the .cs file
    ------------
    void btnSendPriceRan ge_Click(object sender, EventArgs e)
    {
    //do something
    }
    ------------
    i can not reach the btnSendPriceRan ge_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

    #2
    Re: button click event in a AccordionPane control

    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" <DL@DL.comwro te in message
    news:eDu#c3jHJH A.728@TK2MSFTNG P03.phx.gbl...
    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:Accordio n ID="AccordionPa ne1" runat="server" FadeTransitions ="True"
    SelectedIndex=" 0" TransitionDurat ion="300"
    HeaderCssClass= "accordionHeade r"
    ContentCssClass ="accordionCont ent" RequireOpenedPa ne="false">
    <Panes>
    <cc1:AccordionP ane 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="btnSendPric eRange" runat="server" Text="GO"
    OnClick="btnSen dPriceRange_Cli ck" />
    </Content>
    </cc1:AccordionPa ne>
    </Panes>
    </cc1:Accordion>
    >
    ------------
    And the code for the .cs file
    ------------
    void btnSendPriceRan ge_Click(object sender, EventArgs e)
    {
    //do something
    }
    ------------
    i can not reach the btnSendPriceRan ge_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
    >
    >
    >
    >
    >

    Comment

    Working...