Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Leena 29 posts 100 karma points
    Apr 03, 2013 @ 13:29
    Leena
    0

    how to display error message according to current culture

    Hi all,

    I have my website in 2 languages, for login I am using SurfaceConrtoller. To render validation message regarding text box of password / username is empty I am using -

    [Required, Display(Name = "user name")]
    public string Username { get; set; }

    I want to show validation message according to current selected language. How can i do that?

    I am using Umbraco 6.0

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 03, 2013 @ 22:30
    Jan Skovgaard
    0

    Hi Leena

    In order to show different messages depending on the language of the website you should be using the dictionary items, which you can setup in the "Settings -> Dictionary item" folder.

    Then you should be able to use something like umbraco.library.GetDictionaryItem('TheNameOfMyDictionaryItem') - Not sure what to inherit from though...but perhaps intellisense can guide you? :)

    Hope this helps.

    /Jan

  • Leena 29 posts 100 karma points
    Apr 04, 2013 @ 05:48
    Leena
    0

    Hi Jan,

    I think you got me wrong .. I am putting

    [Required,Display(Name="USER NAME")]

    "Required" tag of asp.net so by default it is mandatory field and giving validation message "the USER NAME field is required" if left blank

    I want to localize that validation message too.

Please Sign in or register to post replies

Write your reply to:

Draft