简体   繁体   中英

Mail sending with ASP.NET using AJAX Update Panel

I have an .aspx page using System.Net.Mail for sending E-Mail messages. A linkbutton click event causes this sending process. As you know, I cant disable LinkButton 's PostBack event. It means, when user hits the link, mail sending process occurs, and page posts back. I need to avoid this post back process. So, I need to use Ajax Update Panel , but actually I'm not really good at ASP.NET. My question is, how can I use Ajax Update Panel to send mail without post back? Here is my LinkButton 's Source:

<tr>
   <td>
      <asp:LinkButton class="button" runat="server" OnClick="Button1_Click" ID="bas"><img src="button.png" alt="" />Convert / Cevir</asp:LinkButton>
   </td>
</tr>

You can use update panel like this. Moreover don't forget you create the <asp:scriptmanager> on the page.

<tr>
   <td>
<asp:updatepanel id="updatepnl1" runat="server">
  <contenttemplate>
      <asp:LinkButton class="button" runat="server" OnClick="Button1_Click" ID="bas"><img  src="button.png" alt="" />Convert / Cevir</asp:LinkButton>
  </contenttemplate>
</asp:updatepanel>
   </td>
</tr>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM