Hi,
I am suffering from a strange problem. I made a functionality in which we can send mails to n number of users how far i just have 181 at the moment. I send them mails on daily basis and at the end of process the label appears with text "Success" and at the same time I make note of history which I show afterwards in grid view through a button that appears after sucesfull sending of emails. I have just launched my project and initially it was fine but today I saw that I have send emails and process was completed long ago still my progress image was there revolving and made me assume that process is still going on. Than when I clicked on the link somewhere on the page it logged me out. After logging in and I went to my history page and saw that history was succesfully recorded and mails were succesfuly sent but during the process the success message didn't came up and neither the progress image dissapeared as it was supposed to be. Why did that happen ? Is it due to some page rendering or post back issue from server. When i tested it on local it was working absolutely fine. I am scared that if this will continue to happen It will create issues for my project.
I didn't posted the code because process is working fine only the confirmation is an issue.
for (int ict = 0; ict < dtRecords.Rows.Count; ict++)
{
int iWorkOrderNumb = Convert.ToInt32(dtRecords.Rows[ict]["WorkOrderNumber"]);
string strworkOrder = Convert.ToString(dtRecords.Rows[ict]["WorkOrderName"]);
string strdata = Convert.ToString(dtRecords.Rows[ict]["DataType"]);
string strHSCODE = Convert.ToString(dtRecords.Rows[ict]["HSCODE"]);
string strCombination = Convert.ToString(dtRecords.Rows[ict]["Combination"]);
string strProd = Convert.ToString(dtRecords.Rows[ict]["Product"]);
string strProd_Not = Convert.ToString(dtRecords.Rows[ict]["Product_Not_Like"]);
string strActive = Convert.ToString(dtRecords.Rows[ict]["IsActive"]);
string strEmailId = Convert.ToString(dtRecords.Rows[ict]["EmailId"]);
string strPortname = Convert.ToString(dtRecords.Rows[ict]["Ind_Port"]);
DateTime date_from_subscp = Convert.ToDateTime(dtRecords.Rows[ict]["DateFrom"]);
DateTime date_to_subscp = Convert.ToDateTime(dtRecords.Rows[ict]["DateTo"]);
if (strActive == "NO")
{
DataTable dt_info = bl_daily_email.fetch_failed_credentials(iWorkOrderNumb);
strFailedEmail += Convert.ToString(dt_info.Rows[0]["EmailId"]) + " - " + Convert.ToString(dt_info.Rows[0]["DataType"]) + " - " + Convert.ToString(dt_info.Rows[0]["WorkOrdername"]) + ", ";
}
else if (strActive == "YES")
{
if (date_to_for_daily_email > date_end)
{
String strmsg = "You cannnot select a date less than last mailed date and greater than " + date_end.ToString("dd-MMM-yyyy") + ".";
PopUp_Generation(strmsg);
}
else if (date_from_for_daily_email > date_to_for_daily_email)
{
string strmsg = "Invalid date range. Please check the dates and than try again...";
PopUp_Generation(strmsg);
}
else if (date_to_subscp < date_to_for_daily_email)
{
DataTable dt_info = bl_daily_email.fetch_failed_credentials(iWorkOrderNumb);
strFailedEmail += Convert.ToString(dt_info.Rows[0]["EmailId"]) + " - " + Convert.ToString(dt_info.Rows[0]["DataType"]) + " - " + Convert.ToString(dt_info.Rows[0]["WorkOrdername"]) + ", ";
}
else
{
string[] strArr_email_list = null;
strEmailId = strEmailId.TrimEnd(',');
strArr_email_list = strEmailId.Split(',');
for (int i_count_email = 0; i_count_email < strArr_email_list.Length; i_count_email++)
{
string strEmailID_of_User = Convert.ToString(strArr_email_list[i_count_email]);
iResult = bl_Query_for_admin.Query_Data_Email_Attachment(iWorkOrderNumb,strworkOrder, strdata, date_from_for_daily_email, date_to_for_daily_email, strHSCODE, strCombination, strProd, strProd_Not,strPortname,strEmailID_of_User);
if (iResult == 1)
{
strSucessEmail += "" + strEmailID_of_User + ", ";
}
else
{
DataTable dt_info = bl_daily_email.fetch_failed_credentials(iWorkOrderNumb);
strFailedEmail += Convert.ToString(dt_info.Rows[0]["EmailId"]) + " - " + Convert.ToString(dt_info.Rows[0]["DataType"]) + " - " + Convert.ToString(dt_info.Rows[0]["WorkOrdername"]) + ", ";
}
if (iResult == 1)
{
if (flag == 0)
{
bl_myAccount.insert_last_daily_email_date(date_to_for_daily_email);
flag = 1;
}
lblMsg.Visible = true;
lblMsg.Text = "Email Sent Succesfully !!!";
continue;
}
}
}
}
}
btnLog.Visible = true;
gvAllClients.Visible = true;
Session.Remove("chk_state");
inserting_mail_history(ref strSucessEmail, ref strFailedEmail);
Please suggest me the reason and cure !