单击链接按钮时,需要显示MODALOPUP扩展器
本文关键字:显示 MODALOPUP 扩展器 链接 按钮 单击 | 更新日期: 2023-09-27 18:22:33
点击链接按钮时需要显示MODALOPUP扩展器,在模式弹出式扩展器中,我们需要向所需的邮件ID持有者发送电子邮件。
有什么规范和功能可以在带有C#的ASP.NET中使用吗?请给我最好的建议。
提前感谢
首先,在要发送邮件的aspx页面的代码后面添加下面提到的命名空间。
using System.Net.Mail;
protected void Button1_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
mail.To.Add("Email ID where email is to be send");
mail.To.Add("Another Email ID where you wanna send same email");
mail.From = new MailAddress("YourGmailID@gmail.com");
mail.Subject = "Email using Gmail";
string Body = "Hi, this mail is to test sending mail"+
"using Gmail in ASP.NET";
mail.Body = Body;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential
("YourUserName@gmail.com","YourGmailPassword");
//Or your Smtp Email ID and Password
smtp.EnableSsl = true;
smtp.Send(mail);
}
对于发送邮件,请尝试C#中的上述代码
打开Modalpopup扩展器打开按钮,单击
<div id="hiddenDiv" style="display:none; visibility:hidden;">
<asp:Button runat="server" ID="hiddenButton" />
/div>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderID" runat="server"
BehaviorID="ModalPopupBehaviorID"
TargetControlID="hiddenButton"
PopupControlID="ModalContainer"
/>
...
//Javascript
var modalPopupBehaviorCtrl = $find('ModalPopupBehaviorID');
modalPopupBehaviorCtrl.show();