ToHtmlString() public méthode

Outputs the results as an Html string.
public ToHtmlString ( ) : string
Résultat string
        public virtual ActionResult ChangePassword(ChangePasswordViewModel model)
        {
            if (ModelState.IsValid)
            {
                var result = new ExecutionResults();
                var user = new User
                               {
                                   UserID = SecurityContextManager.CurrentIdentity.Ticket.UserSession.UserID,
                                   Name = model.UserName,
                                   PasswordHash = model.ConfirmPassword
                               };
                if (UserManager.UpdateUser(user, model.OldPassword, Request.UserHostAddress, result))
                {   //success
                    if (this.IsJsonRequest())
                        return Json(new { success = true });

                    return RedirectToAction(MVC.Account.ChangePasswordSuccess());
                }
                //failed business layer rules
                if (this.IsJsonRequest())
                    return Json(new { success = false, message = result.ToHtmlString() });

                for (int e = 0; e < result.Messages.Count; e++)
                {
                    ModelState.AddModelError(e.ToString(CultureInfo.InvariantCulture), result.Messages[e].Message);
                }
                return View(model);
            }
            if (this.IsJsonRequest())
                return Json(new { success = false, errors = ModelState.ToJson() });

            return View(model); //modelstate already populated
        }
        public virtual ActionResult CheckAliasIsAvailable(string alias)
        {
            if (alias == SecurityContextManager.CurrentIdentity.Name)
                return Json(new { success = true, message = "This is your current sign in alias." });

            var result = new ExecutionResults();
            if (!UserManager.ValidateName(alias, result))
                return Json(new { success = false, message = result.ToHtmlString() });

            var user = UserManager.GetUserByName(alias);
            return Json(new { success = (user == null), message = (User == null) ? "This name is available" : "This name is not available.  Choose another name." });
        }
        public virtual ActionResult ForgotPassword(ForgotPasswordViewModel model)
        {
            if (ModelState.IsValid)
            {
                var result = new ExecutionResults();
                ProviderResolver<UserNotificationProvider>.Get.Provider.NotifyPasswordReset(model.UserName, result);

                if (this.IsJsonRequest())
                    return Json(new { success = result.Success, message = result.ToHtmlString() });

                if (result.Success)
                    return RedirectToAction(MVC.Account.Login());

                for (var e = 0; e < result.Messages.Count; e++)
                {
                    ModelState.AddModelError(e.ToString(CultureInfo.InvariantCulture), result.Messages[e].Message);
                }
                return View(model);
            }
            if (this.IsJsonRequest())
                return Json(new { success = false, errors = ModelState.ToJson() });

            return View(model); //modelstate already populated
        }