protected void btnSend_Click(object sender, EventArgs e)
{
try
{
int intResult = 0;
objBLLCommon = new BLLCommon();
intResult = objBLLCommon.SendingMail(txtToMailId.Text, "", hdnEmailSubject.Value.ToString(), Server.MapPath(hdnEmailFilePath.Value).ToString());
if (intResult > 0)
{
//here is alert msg on clicking ok i dont neeed page refersh bcoz i lost data
Response.Write("<script>alert('Email Sent Successfully.'); </script>");
if (File.Exists(hdnEmailFilePath.Value))
{
File.Delete(Server.MapPath(hdnEmailFilePath.Value));
// rptDoc.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Server.MapPath(hdnEmailFilePath.Value));
hdnEmailFlag.Value = "1";
}
}
else
{
Response.Write("<script>alert('Error Occured. Please try again.');</script>");
if (File.Exists(hdnEmailFilePath.Value))
{
File.Delete(Server.MapPath(hdnEmailFilePath.Value));
//rptDoc.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Server.MapPath(hdnEmailFilePath.Value));
hdnEmailFlag.Value = "1";
}
}
}