Hi Ash
Try the following:
1) Create a folder called ResourceFiles
2) Right click on the new folder and add a new resources file called
appResource.resx (Very NB: Default - If no culture is found)
3) Open the resource file and add a key Hello with value Hello
4) Repeat step 2 and name the new resource file appResources.en-AU.resx
(English - Australia)
5) Add a key Hello with a value Gday Mate
6) Create a new webform and add the following:
using System.Resources;
using System.Reflection;
using System.Threading;
using System.Globalization;
In the Page_Load event add:
String SelectedCulture = "en-AU";
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(SelectedCulture);
Thread.CurrentThread.CurrentUICulture =
Thread.CurrentThread.CurrentCulture;
Assembly a = Assembly.GetExecutingAssembly();
ResourceManager rm = new
ResourceManager("MyWebApp.ResourceFiles.appResource", a);
lblHello.Text = rm.GetString("Hello");
That should get you going!
S
"ash" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> ok this may seem like a simply question but Im trying to find out how to
set
> the DEFAULT resource satellite to load in an ASP.net application. I
> understand the hub and spoke architecture and all the rest of it but I
dont
> understand how to do this bit
>
> MSDN QUOTE:
> " To use resources in ASP.NET pages, first create a parallel main
assembly
> to store your application's resources. This assembly will contain the
> DEFAULT or NEUTRAL resources for the application. "
>
> How do I create a parallel main assembly and how do I tell my main
assembly
> to look in that one when it cannot find the resource?? I try compiling the
> ASP.net project including .resources/.resx file without success I even try
> including the resource satellite still without success. Im sure its
> something simply like a project property that you can set but for the life
> of me I cannot find it.
>
> Ive followed all the instructions from what MS has to say about it
>
>
http://msdn.microsoft.com/library/en...asp?frame=true
>
> The code line in question is
>
> Thread.CurrentThread.CurrentCulture =
> CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]);
>
>
> it works when I set my browser to a language that Ive created a satellite
> resource for. However, if I set my browser language to something that I
have
> not supported and the satellite resource doesnt exist it breaks when I try
> to access something from the resourcemanger...
>
> What have I missed or do I have to write my own code to handle it???
>
> Many thanks in advance
> Best Regards
> Ashley Rajaratnam
>
>