Skip to content

Instantly share code, notes, and snippets.

@DmitrySikorsky
Created July 13, 2019 09:33
Show Gist options
  • Save DmitrySikorsky/22c241f795f35e5b420e7eff647fdfdc to your computer and use it in GitHub Desktop.
Save DmitrySikorsky/22c241f795f35e5b420e7eff647fdfdc to your computer and use it in GitHub Desktop.
protected string GetValue(Localization localization)
{
ModelStateEntry modelState;
if (this.ViewContext.ModelState.TryGetValue(this.GetIdentity(localization), out modelState) && !string.IsNullOrEmpty(modelState.AttemptedValue))
return modelState.AttemptedValue;
return localization.Value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment