0
bilalhaidar created
Hi, In one of the .cshtml views I have, I need to display a string using @L(). However, this string is parameterized.
How can I get the value for that setting key in an asp.net-way?
I tried the code below, but since I cannot "await" on the function, I get back name of class "Task...".
@{
var maxPictureSizeName = GetMaxPictureSizeName();
}
@functions {
private async Task<string> GetMaxPictureSizeName()
{
return await SettingManager.(DrcSettings.Imagining.MaxProfilePictureSizeName);
}
}
3 Answer(s)
-
0
Hi,
You can do it directly in cshtml like this.
@L("LocalizationKey", SettingManager.GetSettingValue("NameOfSetting"))
-
0
I only see Async methods, I dont see the normal ones. Do I need to add any references to namespaces?
-
0
I added a using for Abp.Configuration and it worked well.
Thanks