prabhu p

prabhu p

  • NA
  • 181
  • 115k

asp.net

May 28 2015 2:18 AM
how to avoid page refersh  on clicking  alert msg ok button 
 
 
code is here
 
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";
}
}
}

Answers (4)