在asp.net中保存按钮 [英] Save Button in asp.net accordance

查看:103
本文介绍了在asp.net中保存按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,
我在网页中使用了Accordance.
手风琴由
组成

hello friends,
I have used Accordance in my web page.
Accordance consist of

1. text box<br />
2. save button



当我尝试单击保存"按钮时,为保存而编写的代码不会被调用.

这是我的代码
1. aspx code



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



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

推荐答案



我认为您没有在按钮上调用按钮单击方法(btnSaveComments_Click).将btnSaveComments_Click放在按钮的onClick事件上.

快乐编码:)
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 :)


<asp:Button runat="server" Id="btnSaveComments" OnClick="btnSaveComments_Click" Text="Save" style="margin:5px 110px 0px 0px;"/>



之后,您的问题将得到解决.



after that your problem will be solved.


这篇关于在asp.net中保存按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆