ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Localize MultiLookup Title Attribute
Title:
B
I
{code}
?
HI How can I do this? [MultiLookup(Title = (ResourceType = typeof(Mui), Name = "EffectiveDate")))]
Save Changes
Cancel
gotstu
asked at 19 Jun 2014
Answers
B
I
{code}
?
you can change all the default texts as shown here: http://aspnetawesome.com/learn/mvc/general#Changing-default-settings or if you have many languages you can use this approach: http://aspnetawesome.com/learn/mvc/general#Localizing-default-texts for the multilookup title you need this (put this on App_Start): Settings.GetText = GetTranslate; ... private static string GetTranslate(string type, string key) { if (type == "MultiLookup" && key == "Title") return Mui.EffectiveDate; //common stuff switch (key) { case "CancelText": return Mui.Cancel; case "YesText": return Mui.Yes; case "NoText": return Mui.No; case "MoreText": return Mui.more; case "SearchText": return Mui.Search; } return null; } if you need to set the text just for one specific multilookup you can also use the helper extension .Title(Mui.EffectiveDate)
Save Changes
Cancel
Omu
answered at 19 Jun 2014
Sorry I misunderstood your example. I would like to have a localized title set on my input with an attribute.
at 20 Jun 2014
gotstu
there's no attribute for that, you can use [AdditionalMetadata("key", "value")] to send additional data and set the title using .Title, you can access it in the editor template like this: ViewData.ModelMetadata.AdditionalValues
at 20 Jun 2014
Omu
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK