Click here to Skip to main content
15,905,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello friends,
I have used Accordance in my web page.
Accordance consist of
1. text box<br />
2. save button


When i try to click the save button, the code written for save does not get called.

Here is my code
1. aspx code
<cc1:Accordion ID="Accordion1"  runat="server" HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected"
                           ContentCssClass="accordionContent" SelectedIndex="-1" FadeTransitions="true" SuppressHeaderPostbacks="true"
                           TransitionDuration="250" FramesPerSecond="40" RequireOpenedPane="false" AutoSize="None" style="text-align:center;" >
                               <Panes>
                                   <cc1:AccordionPane ID="AccPan1"   runat="server"  önclick="setFocus();">
                                       <Header>
                                            <table width="100%" border="0" cellspacing="2" cellpadding="2">
                                           <tr>
                                               <td style="color:#3B8DBD;text-align:left;">
                                                   Comments:
                                               </td>
                                           </tr>
                                       </table>
                                       </Header>
                                       <Content>
                                           <asp:TextBox TextMode="MultiLine" runat="server" Width="80%" Height="100px" ID="txtComments"
                                           onkeypress="appendText(event);" Text="* ">
                                           </asp:TextBox>
                                           <input type="hidden" value="0" id="hdn1" />
                                           <div style="text-align:right">
                                               <asp:Button runat="server" Id="btnSaveComments" Text="Save" style="margin:5px 110px 0px 0px;"/>
                                           </div>
                                       </Content>
                                   </cc1:AccordionPane>
                               </Panes>
                           </cc1:Accordion>


2.code behind code
protected void btnSaveComments_Click(object sender, EventArgs e)
   {
       string[] comments = txtComments.Text.Split('*');
       txtComments.Text = "";
   }



Can anyone tell, why there is no call to code??
Where I'm going wrong??

Thanks in advance =)
Posted

Hi,

I think you didn't call you button click method (btnSaveComments_Click) on your button. Put btnSaveComments_Click on the onClick event of your button.

Happy Coding :)
 
Share this answer
 
Comments
dhage.prashant01 4-Jun-12 1:07am    
Great done
Btw when i double click the event, it automatically gets bind to the button.
Dont know what went wrong.
Now its working fine =)
thnks
Linto Leo Tom 4-Jun-12 1:15am    
you are welcome...
XML
<asp:Button runat="server" Id="btnSaveComments" OnClick="btnSaveComments_Click" Text="Save" style="margin:5px 110px 0px 0px;"/>


after that your problem will be solved.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900