<div class="popup" id="invite-box">
<asp:UpdatePanel ID="upd1" runat="server">
<ContentTemplate>
<a href="#" class="close">close</a>
<div class="popup-holder">
<div class="popup-frame">
<div class="container">
<div action="#" class="invite-form" >
<div class="email">
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></div>
<div class="textarea">
<div class="textarea-holder">
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Rows="10" Columns="30"></asp:TextBox>
</div>
</div>
<div class="btn-holder">
<a href="#" class="btn-view">View sample e-mail</a>
<asp:LinkButton ID="LinkButton6" runat="server" CssClass="btn-send"
onclick="LinkButton6_Click"></asp:LinkButton>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
这是我的弹出代码,我正在尝试在链接按钮单击时发送邮件,但是在后面的代码中没有调用 LinkButton_Click
我的代码如下:
protected void LinkButton6_Click(object sender, EventArgs e) // Not getting called
{
if (r1.Checked == true)
{
try
{
MailMessage mail = new MailMessage();
mail.Subject = "Some one has invited you: Join abc! Meet ## of %%";
mail.Body = mee.data[0].name+"</br>"+TextBox1.Text;
mail.To.Add(TextBox2.Text);
////send the message
SmtpClient mySmtpClient = new SmtpClient();
System.Net.NetworkCredential myCredential = new System.Net.NetworkCredential("****", "*****");
//mySmtpClient.Port="25";
mySmtpClient.Host = "abc";
mySmtpClient.UseDefaultCredentials = false;
mySmtpClient.Credentials = myCredential;
mySmtpClient.Send(mail);
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
编辑:
我认为我的代码正在考虑将链接按钮作为 javascript 按钮
谢谢