Click here to Skip to main content
14,244,162 members
Rate this:
Please Sign up or sign in to vote.
See more:
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")
    {

        //((date_from_for_daily_email < date_start) ||
        if (date_to_for_daily_email > date_end)
        {
            //lblMsg.Visible = true;
            //lblMsg.Text = "You cannnot select a date less than last mailed date and greater than " + date_end.ToString("dd-MMM-yyyy") + ".";
            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)
        {
            //lblMsg.Visible = true;
            //lblMsg.Text = "Invalid date range. Please check the dates and than try again...";
            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 !
Posted
Updated 21-Sep-12 1:16am
v2
Comments
OriginalGriff 21-Sep-12 7:11am
   
Without the relevant code to give us a clue, we can do nothing...
_Amy 21-Sep-12 7:11am
   
Where is your dummy code? Which code you are using for it?
Taresh Uppal 21-Sep-12 7:16am
   
here is my dummy code too...
Taresh Uppal 21-Sep-12 7:30am
   
any help now ???
   
How are you working with Progress Bar ?
Can you show us the related code of progress Bar ?
Taresh Uppal 21-Sep-12 8:40am
   
I am actually not using any progress bar..I am using progress image that too without any ajax.. it is supposed to stay on the page as long as the process goes on and once the label comes up I hide it throgh code behind :
Here it is :<td colspan="2">
<asp:Image ID="Image_progress" runat="server" Height="30px" ImageUrl="~/images/indicator.gif"
Style="visibility: hidden; text-decoration: blink;" ToolTip="Mining is in progress.."
Width="30px" />
<asp:Label ID="lbl_blink" runat="server" Font-Size="14px" Font-Bold="true" ForeColor="Red"
Text="Processing..." Style="visibility: hidden; text-decoration: blink;">
</td>

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Which .net framework you are using...?
   
Comments
Taresh Uppal 28-Sep-12 3:15am
   
3.5 and i guess that has nothing to do with it..its some server side breakdown occurence if m not wrong..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100