Jgrowl message displays unwanted

try{

      myConnection.Open();
      SqlCommand myCommd = new SqlCommand(StrMemberId, myConnection);
      myCommd.Parameters.AddWithValue("@MemberId", TxtEnterMemberId.Text);
        int value=(int)myCommd.ExecuteScalar();

        if (value!= 0 )
        {
            Response.Redirect("GeneralExamination.aspx? MemberId=" + this.TxtEnterMemberId);
        }

        else
        {
            string js = "$.jGrowl('  Invalid Member Id Try Again ');";
            Page.ClientScript.RegisterStartupScript(typeof(string), "jgrowlwarn", js, true);
            TxtEnterMemberId.Text = "";
        }


    }

    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
    finally {
        myConnection.Close();
    }

} 

      

What I'm trying to do here is search for a member if it doesn't exist or an invalid input. jgrowl will show a message (works great). i.) Now the problem is that when I give the correct member a message is generated that says "thread is aborted". but it redirects to the given page. What is this exception?

ii.) When I go to the next page and click the Back button. The MSN field says "To display this page, Firefox must send information that will repeat any actions (such as searching or confirming an order) that were previously performed." if I press it again, the growl reappears. How to deal with this?

Help overcome problems.

+2


a source to share


1 answer


I) I believe the exception is to create a Response.Redirect inside the try / catch block, to avoid the exception, you could add a false parameter to redirect.



More information: ThreadAbortException is thrown if you use Response.End, Response.Redirect, or Server.Transfer

+1


a source







All Articles