Search code examples
asp.netmultilingualresource-filesvalidation-controls

Read validation control error messages from local resource files


I need to read error message of validation controles (RequiredFeildValidator) from resource files in my App_LocalResource folder as my web app is multilingual....

<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                        ControlToValidate="ddlTicketType" ErrorMessage="Ticket type required." 
                        ForeColor="White" InitialValue="Select" SetFocusOnError="True" 
                        ValidationGroup="tkt" meta:resourcekey="RequiredFieldValidator4Resource1">*</asp:RequiredFieldValidator>

and the key "RequiredFieldValidator4Resource1" is existed in resource file as some text...but it is not picking up the exact value, rather it is showing some unreadable content......

I changed my ValidationSummary to ShowMessageBox="False" & ShowSummary="True" and it works, it showed me desired result.....i want them to be work in Message Box too.....

Every other thing are working fine, like text in labels and in other controles like buttons, hyper links are coming correctly.....


Solution

  • after scracthing my head for so many days, finally i found answer for this...the javascript alert and validation control message box uses your local computer language & cultural...i have enables it for the culture i want and it worked like a charm...thanks