TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
prabhu p
NA
181
114.4k
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";
}
}
}
Reply
Answers (
4
)
How to update specific column in gridview?
file upload value loses when pressing any buttun on form