public ActionResult ChangePassword(ChangePasswordViewModel viewmodel)
 {
     try
     {               
         string name = viewmodel.TokenString;
         if (name == "") { name = Request.QueryString["resetToken"]; }
         int cId = viewmodel.client_Id;
         int pId = viewmodel.portal_Id;
         ReadDataFromRouteData("changePassword");
         viewmodel.Resources = resources;
         
         if((viewmodel.NewPassword==null)||(viewmodel.ConfirmPassword==null))
         {
             return RedirectToAction("ChangePassword/" + clientId + "/" + portalId, "Account", new { Message = "3", resetToken = name });
         }
         if (viewmodel.NewPassword != viewmodel.ConfirmPassword)
         {
             return RedirectToAction("ChangePassword/" + clientId + "/" + portalId, "Account", new { Message = "1", resetToken = name });
         }
         if ((viewmodel.NewPassword.Length < 6) || (viewmodel.ConfirmPassword.Length < 6))
         {
             return RedirectToAction("ChangePassword/" + clientId + "/" + portalId, "Account", new { Message = "2", resetToken = name });
         }
         bool result = _tokenManager.SavePassword(name, viewmodel.NewPassword, clientId, portalId);
         if(result==true)
             return RedirectToAction("Login/" + clientId + "/" + portalId, "Account", new { Message = "3" });
         else
             return RedirectToAction("ChangePassword/" + clientId + "/" + portalId, "Account", new { Message = "4", resetToken = name });
        
     }
     catch (Exception ex)
     {
         KBCustomException kbCustExp = KBCustomException.ProcessException(ex, KBOp.ChangePassword, KBErrorHandler.GetMethodName(), GeneralResources.ChangePasswordError,
             new KBExceptionData("portalId", portalId), new KBExceptionData("clientId", clientId));
         throw kbCustExp;
     }
 }
 // GET: /Account/ Cancel Reset Password       
 public ActionResult ChangePassword(string Message)
 {
     try
     {
         ReadDataFromRouteData("changePassword");
         ChangePasswordViewModel viewModel = new ChangePasswordViewModel();
         viewModel.TokenString = Request.QueryString["resetToken"];
         viewModel.client_Id = clientId;
         viewModel.portal_Id = portalId;
         viewModel.Resources = resources;
         ViewBag.Message = Message;
         return View(viewModel);
     }
     catch (Exception ex)
     {
         KBCustomException kbCustExp = KBCustomException.ProcessException(ex, KBOp.ChangePassword, KBErrorHandler.GetMethodName(), GeneralResources.ChangePasswordError,
             new KBExceptionData("portalId", portalId), new KBExceptionData("clientId", clientId));
         throw kbCustExp;
     }
 }