bi-lingual implementation in asp.net
-
I was working on a bi-lingual asp.net site.. i have a label(lblmessage) to show messages. I have 2 messages to be shown there( if the process is successfull, the a sucess message should be shown else error message should be shown. I have added two string values in resx files success and failure. I have two languages resource files(default.aspx.resx and default.aspx.fr.resx) I have given the values for success and failure in both files. During run time how can i show the message from the resource files? i have the current selected language in session object as session["language"]. plz help thanks and regards Hari
-
I was working on a bi-lingual asp.net site.. i have a label(lblmessage) to show messages. I have 2 messages to be shown there( if the process is successfull, the a sucess message should be shown else error message should be shown. I have added two string values in resx files success and failure. I have two languages resource files(default.aspx.resx and default.aspx.fr.resx) I have given the values for success and failure in both files. During run time how can i show the message from the resource files? i have the current selected language in session object as session["language"]. plz help thanks and regards Hari
Read the MSDN documentation. Session["language"] will not cut it. Also you need to know the difference between a global and a local resource, as they as handled differently. From what I can see, you are using local resources (they are bound to a page or control). There are 2 ways to do it: 1. Use VS to generate it (all the stuff is added). 2. Use Resource expressions. Note: Global resources you can access via
Resources.ResourceName.Property
.xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 alpha 3 out now