button click event in a AccordionPane control

S

Sinan Alkan

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
 
M

Mark Fitzpatrick

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top