0

Have searched for solutions and also tried different things but unable to find solution for this one. So my question is: I have a form with fields like name,email,contact no for registration. Once i click on the button what i am doing is that i am allowing user to download a file for which i have written the code as below

 [HttpPost]
        public ActionResult MBA_Programme(mba_programmeViewModel vm)
        {
            if (vm.mba_Id == null || vm.mba_Id == 0)
            {
                vm.Created_Date = DateTime.Now;
                vm.Created_By = User.Identity.Name.ToString();
                admin.addMbaDetail(vm);
                if (vm.Flag != null)
                {
                    ModelState.Clear();
                    return new FilePathResult(Server.MapPath("~/eiclandingpages/EIC-MBA.doc"), "application/msword");

                }
                else
                {
                    return RedirectToAction("MBA_Programme", "EIC");
                }

            }

            else
            {
                return RedirectToAction("MBA_Programme", "EIC");
            }


        }

The issue which i am facing is that once the form is getting downloaded the page is not getting refresh . I tried modelstate.clear() but not able to do it . I tried jquery also for location.reload but it refreshes but file wont downlaod and also refresh with delay. Kindly help. p.s: file i am getting from the folder in the project

Neerav Poriya
  • 23
  • 1
  • 10

0 Answers0