Security exception when redirecting to another page
<p>bellow is my code in which when i am redirecting to another page its throwing an error as security exception. while debugging on local it works fine.</p>

<pre><code>protected void btnSubmit_Click(object sender, EventArgs e)
{
    try
    {
        clsProductProp objProductProp = new clsProductProp();
        objProductProp = (clsProductProp)Session["ProductDetails"];
        clsCommon objCommon = new clsCommon();
        bool IsDone = false;
        Int32 Vol_ProductId = 0;
        //--------------------------check for directory existence------------------
        if (System.IO.Directory.Exists(Server.MapPath("ProductImages") + "\\" + user))
        {
            Path = Server.MapPath("ProductImages") + "\\" + user;
        }
        else
        {
            Directory.CreateDirectory(Server.MapPath("ProductImages") + "\\" + user);

            if (System.IO.Directory.Exists(Server.MapPath("ProductImages") + "\\" + user))
            {
                Directory.CreateDirectory(Server.MapPath("ProductImages") + "\\" + user + "\\Image");
                Directory.CreateDirectory(Server.MapPath("ProductImages") + "\\" + user + "\\Thumb");
            }
            Path = Server.MapPath("ProductImages") + "\\" + user;
        }
        objProductProp.vendorId = Convert.ToInt32(Session["LOGIN_ID"]);
        if (ViewState["ReturnURL"].ToString() == "/AddProduct.aspx")
        {
            try
            {
                Vol_ProductId = InsertThrVolsuionAPI(objProductProp);
            }
            catch (Exception ex)
            {                    
                 lblError.Text = "Problem with connectin API, please try again.";
            }
            //insert thr' volusion API
            if (Vol_ProductId &gt; 0)
            {
                IsDone = objProduct.InsertProduct( objProductProp , Vol_ProductId );
                if (IsDone)
                {
                    ArrayList values = new ArrayList();
                    values = (ArrayList)Session["CatValue"];
                    foreach (string item in values)
                    {
                        objProduct.UpdateCategoryOfProduct(Vol_ProductId, item, objProductProp.vendorId);    
                    }
                    Session["CatValue"] = null;
                }
            }
        }
        else
        {
            try
            {
                Vol_ProductId = UpdateThrVolsuionAPI(objProductProp);
            }
            catch (Exception ex)
            {
                lblError.Text = "Problem with connectin API, please try again.";
            }

            if (Vol_ProductId &gt; 0)
            {
                IsDone = objProduct.UpdateProduct(objProductProp);
                //Old session values
                ArrayList values = new ArrayList();
                values = (ArrayList)Session["NewCatValue"];

                //New session values
                ArrayList Newvalues = new ArrayList();
                Newvalues = (ArrayList)Session["NewCatValue"];

                foreach (string item in Newvalues)
                {                      
                    objProduct.UpdateCategoryOfProduct(Vol_ProductId, item, objProductProp.vendorId);                        
                }
                Session["CatValue"] = null;
            }               
        }
        if (Vol_ProductId &gt; 0)
        {
            try
            {
                if (objProductProp.image1 != "")
                {
                    //Path = Server.MapPath("PeviewImages" + "\\" + user);
                    string fullImageName = Server.MapPath("PeviewImages" + "\\" + user) + "\\Image\\" + objProductProp.image1;
                    string DestPath = Server.MapPath("ProductImages" + "\\" + user) + "\\Image\\" + objProductProp.image1;
                    if (Session["OldImage1"].ToString() == "false")
                        if (File.Exists(DestPath))
                        {
                            File.Delete(DestPath);
                        }
                    if (File.Exists(fullImageName))
                    {
                        File.Move(fullImageName, DestPath);
                        FileTransfer("~/ProductImages//" + user + "//Image//" + objProductProp.image1, objProductProp.image1);
                    }
                    string fullImageName1 = Server.MapPath("PeviewImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image1thumb1;
                    string DestPath1 = Server.MapPath("ProductImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image1thumb1;

                    if (Session["OldImage1"].ToString() == "false")
                        if (File.Exists(DestPath1))
                        {
                            File.Delete(DestPath1);
                        }
                    if (File.Exists(fullImageName1))
                    {
                        File.Move(fullImageName1, DestPath1);
                        FileTransfer("~/ProductImages//" + user + "//Thumb//" + objProductProp.image1thumb1, objProductProp.image1thumb1);
                    }

                    string fullImageName2 = Server.MapPath("PeviewImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image1thumb2;
                    string DestPath2 = Server.MapPath("ProductImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image1thumb2;

                    if (Session["OldImage1"].ToString() == "false")
                        if (File.Exists(DestPath2))
                        {
                            File.Delete(DestPath2);
                        }
                    if (File.Exists(fullImageName2))
                    {
                        File.Move(fullImageName2, DestPath2);
                        FileTransfer("~/ProductImages//" + user + "//Thumb//" + objProductProp.image1thumb2, objProductProp.image1thumb2);
                    }

                    string fullImageName3 = Server.MapPath("PeviewImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image1thumb3;
                    string DestPath3 = Server.MapPath("ProductImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image1thumb3;

                    if (Session["OldImage1"].ToString() == "false")
                        if (File.Exists(DestPath3))
                        {
                            File.Delete(DestPath3);
                        }
                    if (File.Exists(fullImageName3))
                    {
                        File.Move(fullImageName3, DestPath3);
                        FileTransfer("~/ProductImages//" + user + "//Thumb//" + objProductProp.image1thumb3, objProductProp.image1thumb3);
                    }

                    string fullImageName4 = Server.MapPath("PeviewImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image1thumb4;
                    string DestPath4 = Server.MapPath("ProductImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image1thumb4;

                    if (Session["OldImage1"].ToString() == "false")
                        if (File.Exists(DestPath4))
                        {
                            File.Delete(DestPath4);
                        }
                    if (File.Exists(fullImageName4))
                    {
                        File.Move(fullImageName4, DestPath4);
                        FileTransfer("~/ProductImages//" + user + "//Thumb//" + objProductProp.image1thumb4, objProductProp.image1thumb4);
                    }
                }
                if (objProductProp.image2 != "")
                {

                    string fullImageName = Server.MapPath("PeviewImages" + "\\" + user) + "\\Image\\" + objProductProp.image2;
                    string DestPath = Server.MapPath("ProductImages" + "\\" + user) + "\\Image\\" + objProductProp.image2;

                    if (Session["OldImage2"].ToString() == "false")
                        if (File.Exists(DestPath))
                        {
                            File.Delete(DestPath);
                        }
                    if (File.Exists(fullImageName))
                    {
                        File.Move(fullImageName, DestPath);
                        FileTransfer("~/ProductImages//" + user + "//Image//" + objProductProp.image2, objProductProp.image2);
                    }

                    string fullImageName1 = Server.MapPath("PeviewImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image2thumb1;
                    string DestPath1 = Server.MapPath("ProductImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image2thumb1;

                    if (Session["OldImage2"].ToString() == "false")
                        if (File.Exists(DestPath1))
                        {
                            File.Delete(DestPath1);
                        }
                    if (File.Exists(fullImageName1))
                    {
                        File.Move(fullImageName1, DestPath1);
                        FileTransfer("~/ProductImages//" + user + "//Thumb//" + objProductProp.image2thumb1, objProductProp.image2thumb1);
                    }

                    string fullImageName2 = Server.MapPath("PeviewImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image2thumb2;
                    string DestPath2 = Server.MapPath("ProductImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image2thumb2;

                    if (Session["OldImage2"].ToString() == "false")
                        if (File.Exists(DestPath2))
                        {
                            File.Delete(DestPath2);
                        }
                    if (File.Exists(fullImageName2))
                    {
                        File.Move(fullImageName2, DestPath2);
                        FileTransfer("~/ProductImages//" + user + "//Thumb//" + objProductProp.image2thumb2, objProductProp.image2thumb2);
                    }

                    string fullImageName3 = Server.MapPath("PeviewImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image2thumb3;
                    string DestPath3 = Server.MapPath("ProductImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image2thumb3;

                    if (Session["OldImage2"].ToString() == "false")
                        if (File.Exists(DestPath3))
                        {
                            File.Delete(DestPath3);
                        }
                    if (File.Exists(fullImageName3))
                    {
                        File.Move(fullImageName3, DestPath3);
                        FileTransfer("~/ProductImages//" + user + "//Thumb//" + objProductProp.image2thumb3, objProductProp.image2thumb3);
                    }
                }
                if (objProductProp.image3 != "")
                {
                    string fullImageName = Server.MapPath("PeviewImages" + "\\" + user) + "\\Image\\" + objProductProp.image3;
                    string DestPath = Server.MapPath("ProductImages" + "\\" + user) + "\\Image\\" + objProductProp.image3;

                    if (Session["OldImage3"].ToString() == "false")
                        if (File.Exists(DestPath))
                        {
                            File.Delete(DestPath);
                        }

                    if (File.Exists(fullImageName))
                    {
                        File.Move(fullImageName, DestPath);
                        FileTransfer("~/ProductImages//" + user + "//Image//" + objProductProp.image3, objProductProp.image3);
                    }

                    string fullImageName1 = Server.MapPath("PeviewImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image3thumb1;
                    string DestPath1 = Server.MapPath("ProductImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image3thumb1;

                    if (Session["OldImage3"].ToString() == "false")
                        if (File.Exists(DestPath1))
                        {
                            File.Delete(DestPath1);
                        }
                    if (File.Exists(fullImageName1))
                    {
                        File.Move(fullImageName1, DestPath1);
                        FileTransfer("~/ProductImages//" + user + "//Thumb//" + objProductProp.image3thumb1, objProductProp.image3thumb1);
                    }

                    string fullImageName2 = Server.MapPath("PeviewImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image3thumb2;
                    string DestPath2 = Server.MapPath("ProductImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image3thumb2;

                    if (Session["OldImage3"].ToString() == "false")
                        if (File.Exists(DestPath2))
                        {
                            File.Delete(DestPath2);
                        }
                    if (File.Exists(fullImageName2))
                    {
                        File.Move(fullImageName2, DestPath2);
                        FileTransfer("~/ProductImages//" + user + "//Thumb//" + objProductProp.image3thumb2, objProductProp.image3thumb2);
                    }

                    string fullImageName3 = Server.MapPath("PeviewImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image3thumb3;
                    string DestPath3 = Server.MapPath("ProductImages" + "\\" + user) + "\\Thumb\\" + objProductProp.image3thumb3;

                    if (Session["OldImage3"].ToString() == "false")
                        if (File.Exists(DestPath3))
                        {
                            File.Delete(DestPath3);
                        }
                    if (File.Exists(fullImageName3))
                    {
                        File.Move(fullImageName3, DestPath3);
                        FileTransfer("~/ProductImages//" + user + "//Thumb//" + objProductProp.image3thumb3, objProductProp.image3thumb3);
                    }
                }

                DeleteImages(objProductProp);
                objProductProp = null;

                if (ViewState["ReturnURL"].ToString() == "/AddProduct.aspx")
                {
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                    Response.Redirect("VendorMessage.aspx?ProductIsOpen=true&amp;id=1", false);
                }
                else
                {
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                    Response.Redirect("VendorMessage.aspx?ProductIsOpen=true&amp;id=2", false);
                }
            }
            catch (Exception ex)
            {
                lblError.Text = "Sorry!, There was a problem, please try again.";
            }
        }
        else
            Response.Write("&lt;script language='javascript'&gt;alert('Product Already Exists.')&lt;/script&gt;");
    }
    catch (Exception ex)
    {
        lblError.Text = "Sorry!, There was a problem, please try again.";
    }   
} 
</code></pre>

<p>Can you please tell me where is problem.</p>
