I have a configuration that is saved in the database. I need to show that configuration in the label name. I am unable to use a replace functionality in the Razor view while fetching label value from Display Name.
Model Code:
[Display(Name = "SomeFooText XYZ typing speed")]
public decimal SomeFooText{ get; set; }
Something like below. I'm unable to find a code that would work for this scenario.
@Html.LabelFor(model => model.SomeFooText).Replace ("XYZ", model.configurationfromDB)
or
(<label asp-for="SomeFooText"></label>).Replace ("XYZ", model.configurationfromDB)
In worst case, I can move the code to c# and hardcode the "SomeFooText XYZ typing speed" and then use string.replace or use javascript to replace but just want to see if there is something that can be used on control directly.