C# - How To Load Different RESX Files Based On Some Parameter

Sep 3, 2010

I have an ASP.NET3.5 (C#) ASPX page that is internationalized in 10 different languages.

The page is very complex in its structured with dozens of nested views driven by a state machine pattern.

EDIT: I am using the meta:resourcekey syntax in every asp control, which allows to use declarative syntax for Implicit Resource expressions.

I have been asked to "brand" the page based on some query string parameter. Branding will mean not just loading different CSS files, but also having different text blurbs (in all languages).

Is there an easy way to "swap" resx files without having to get resources manually for each of the hundreds of literals and images that I have on this page?

In other words, let's say I have the following RESX files:

brand1_myPage.aspx.en-US.resx
brand1_myPage.aspx.de-DE.resx
brand1_myPage.aspx.fr-FR.resx
brand2_myPage.aspx.en-US.resx
brand2_myPage.aspx.de-DE.resx
brand2_myPage.aspx.fr-FR.resx

myPage.aspx will be looking for resx files named myPage.xx-XX.resx.

Is there a way to load instead either the brand1xxx.resx files or the brand2xxx.resx based on some value?

View 2 Replies


Similar Messages:

Configuration :: ResourceManager And Resx Files - Files To Display Items In Multiple Languages

Oct 13, 2010

I have an application that uses resource files to display items in multiple languages. My app uses quote a lot of javascript and the alerts need to display in the local language. To do this, I have created an http handler which will read the keys and values of the culture-specific resource file and write them to a JSON array which is then embedded in the page in a script tag, the messages can then be accesses using, for exmaple:

Message.Error (en-GB = "Error", fr-FR = "Erreur")

The messages http handler works great in development, however when I run the application on a test server, I get the error: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Resources.Alerts.resources" was correctly embedded or linked into assembly "App_GlobalResources.b0n9j90e" at compile time, or that all the satellite assemblies required are loadable and fully signed. The code that I use to acccess the resource file is:

ResourceManager manager = Resources.Alerts.ResourceManager;
ResourceSet resourceSet= Resources.Alerts.ResourceManager.GetResourceSet(Thread.CurrentThread.CurrentCulture, true, true);

Where Resources.Alerts is the type that contains my multi-lingual definitions. The build action for the Alerts.resx file is set to "Embedded Resource". Any ideas why this works locally but not on my test server, am I missing something?

View 1 Replies

Localization :: Load Data From Resx To Ddl?

Jan 18, 2011

I am having difficulties loading the data from resx file to ddl control.

Inside the resx file the format is:

Name: CData

Value:

<countries>
<c text="Canada" value="1"/>
<c text="USA" value="2"/>
<c text="Africa" value="3"/>
</countries>

cs file:

ddl.DataSource = this.GetLocalResourceObject("CData");
ddl.DataTextField = "text";
ddl.DataValueField = "value";
ddl.DataBind();

At debug mode, I checked that the data is been capture from resource file as shown above (xml format) But it fails at DataBind(), showing that the text is not found...

View 3 Replies

.net - Mvc 2, Resx Files And Page Translation?

Apr 2, 2011

I've used a very interesting article (which i recommend, you can see it here :http://adamyan.blogspot.com/), and i've started to localize my asp net mvc2 site.However, i've come to a point where i don't know if it would be possible to do something else, or if i just have to do it this way The thing is, most of the pages are text and links and stuff. In general, all of the links i have them using some markup and calling the Html.ActionLink (for example). So, if i'm translating a page that has 20 links, i would have to split all of those texts into 20 entries in the resx file (and the Html.ActionLink text would have to have its own resx entry, of course). I find this a little bit unpractical. Is there a way to just copy the whole contents, and make some intermediary parse the tags in the resx file and call the appropriate code?

View 1 Replies

Read Values From Resx Files?

Apr 17, 2010

How to read strings from the MyResource.resx file from c#. I am not calling this from the asp.net page, rather i am calling from my bussiness logic.

Assembly assembly =
this.GetType().Assembly;
ResourceManager resourceManager = new
ResourceManager("MessagesResource",
assembly);
resourceManager.GetString("SCHEME_UNQ");

here i am getting exception,

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "MessagesResource.resources" was correctly embedded or linked into assembly "App_Web_eerdggo8" at compile time, or that all the satellite assemblies required are loadable and fully signed.

View 1 Replies

Localization :: Call Resx Based On Language Selection?

Jul 13, 2010

i has 2 resx files Test1.aspx.resx (for english) Test1.aspx.ko.resx(for korean) its working fine when language has changed on IE settings(that is automatic detection), my question is on my page i has a dropdownlist and showing the languages list, based on the user selected language i have to display language resx file. by default its automatically working based on the culture and no need to write any new code, but how to do this by user selected language?

View 9 Replies

Localization :: Resgen.exe Generate Different Resx Files And How To Apply

Dec 15, 2010

I have the intranet application project with using properties.resources class. There is a resources.resx file.Now I have generated using resgen.exe from txt file into different languages resx file, e.g. resources.Fr.resx...( resgen fr.txt resources.Fr.resx)How to apply resources.resx or resources.Fr.resx into the program with setting and configuration??e.g. In resources.designer.cs, it has culture setting. Is it related?

View 2 Replies

Localization :: Online Tool For Translating Resx Files?

Feb 18, 2010

I'm using resx files to localize my asp.net 2.0 application. As it's freeware I need the help of many users translating it for free. I don't want to use automatic translation as there are my special terms which need to be translated exactly.Is there somewhere an online tool where resx-files could be translated? My users might have different operating systems, so having an online tool would be the best to find new users translating the pages.

View 8 Replies

Localization :: How To Update Website's Content With Resx(resources) Files

Apr 20, 2010

I was just wondering guys, how did you manage to update website's content with resx(resources) files.Did you manage user's database with connection, accessing to this page. I need to make a poll as well, should I use sharepoint or c# with a database?

View 1 Replies

Localization - Put Resource Files (.resx) Within Subfolders Inside App_GlobalResources?

Mar 30, 2010

Is it possible to put resource files (.resx) within subfolders inside App_GlobalResources? For example:

/App_GlobalResources/someresources/myfile.resx
/App_GlobalResources/someresources/myfile.fr-fr.resx
/App_GlobalResources/othereresources/otherfile.resx
/App_GlobalResources/othereresources/otherfile.fr-fr.resx

Or, are all the .resx files placed directly inside App_GlobalResources? If it is possible to use subfolders, how do you programmatically access resources within subfolders?

View 2 Replies

.net - Free / Open Source Resx Files With Standard Phrases?

Jan 16, 2010

I was wondering if there are any free/OS resx files for phrases commonly used among websites. For instance, we all use save/submit/retry/cancel/etc. and I'd be surprised if there wasn't a library out there with these standard phrases in multiple languages.

View 1 Replies

C# - .resx Serialization / List Of All Valid Keys For A Given *.resx File

May 14, 2010

I'm contributing on an I18N project and there's a call to serialize our *.resx files as JSON objects (for whatever reason).

What I'm wondering is:

Is there a way to get a list of all of the valid keys for a given *.resx file so that we could use HttpContext.GetGlobalResourceObject to grab the tokens?
If that won't work, has anyone come up with a clever solution that does?

View 1 Replies

SQL Reporting :: Parameter Enabling Based On Selection In Another Parameter?

Nov 12, 2010

I have a parameter Owner with 1,2,3 options in dropdown.

On selection of option 1 , a country parameter should be enabled with all countries' values defaulted.

Option 2 should enable Region parameter with all the Regions values selected and country parameter should be displayed.

Option 3 should disable both Region & Country Parameter.

I am using SSRS 2005 with Enesys tool as add on.

View 2 Replies

Localization :: Create "Pick Languages" Usercontrol From Resx Files?

Apr 6, 2010

I am a little bit of confused here. I translated resx files to lots of languages, and I am looking for the best way to allow user to select it's language.I think that maybe a country selection would be better then a language selection. what do you think?I have a .resx file translation of about 100 languages. What is missing now is an easy to use DropDownList with flags (auto population according to the resx files)I am looking for an easy way to associate the DropDownlList.SelectedIndex to the CultureInfo property, so user will be able select the corect language.Since this is a common use, Is there a ready to use control doing so?

View 2 Replies

Localization :: Localization With Resx-files?

Jan 15, 2010

I found the solution. Just override InitializeCulture().

View 1 Replies

Web Forms :: Parameter Error In The Web Based Application?

Sep 28, 2010

I am working on a web based application wherein I have a created 2 dropdown lists for the user to select. If the user does not select any value from any or both of the dropdown lists, they should see a message- 'Please a select a value for trade code' or 'Please a select a value for direction'. Instead I am getting this development error:

'Procedure or function 'usp_AdminPageCustomerGroupingSearch' expects parameter '@tradecode', which was not supplied.'

As I am still novice to asp.net or C#, I am unable to find the correct code to catch this error and display the relevant message to the user. Could someone please help me with this ? The following is the slice of the C# code which is related to the dropdown list:

private

{

void populateGV()DataView dv = [code]....

View 19 Replies

MVC :: Dynamically Change The Controller During A Request Based Upon A Parameter?

Aug 11, 2010

I have a requirement whereby I need to be able to change the controller being used based upon a parameter. I am creating an application that needs to be dynamic enough to be able to change controllers on the fly. Let me explain further;

When the application starts a dictionary of custom controller names is loaded with a controller name as the key and a custom controller name as the value. This will be help in the application scope.

When a request is made I need to access the requested controller name, use that name and check to see if it matches a key in my controller dictionary and if so, replace the requested controller name with the custom controller name from the dictionary.

example;

My dictionary will contain data as follows
Key: 'Home', Value: 'Home_IN'
Key: 'Customer', Value: 'Customer_BE'

Now, the following request is made 'User/Edit/1'. Does the controller name exist in the dictionary? No, continue with original request.

Now, the following request is made 'Home/Details/2'. Does the controller name exist in the dictionary? Yes, replace the original controller name 'Home' withe custom controller name 'Home_IN' so changing the requested URL to be 'Home_IN/Details/2'.

Does this make sense?

My problem here is knowing exactly where in the request cycle I need to do this?

I am assuming I need to create my own custom controller factory?

View 7 Replies

Web Forms :: Display Image Based On Value From QueryString Parameter

Jun 30, 2013

In my asp.net+vb web with access database there is a page which displays data as per query string and the string is PNO and all data is correctly displayed in gridview and dataview. there is a Image1.ImageUrl and i used the following code but it is not working

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim PNO As String
PNO = Request.QueryString("PNO")
Image1.ImageUrl = "C:/wing/Photos/" + PNO + ".jpg"
End Sub

View 1 Replies

MVC :: IEnumerable - Null Files Parameter

Feb 3, 2010

i'm using MVC 2, RC, and i have a controller method:

[Code]....

and i have an <input type="file"../> in my form. during post, however, the files parameter is null.

View 9 Replies

Web Forms :: Dynamically Load An UserControl With Parameter?

Aug 7, 2010

I have this user control :

[Code]....

and i load it dynamicly in Default.aspx like this :

[Code]....

How can I pass the title value ?

View 4 Replies

DataSource Controls :: Building Where Statement Dynamically Based On Parameter Value?

Aug 9, 2010

How can i check a parameter value and add onto or remove conditions from my where statement.Here is what i mean.. i have a stored procedure that is being used for returning small set of fields based on a parameter that it is expecting. Since the only difference between the select statements are the last AND condition, i was wondering if i can check that parameter as im doing now but change that AND condition so that i have only 1 select statement instead of 3 within my procedure.Current Example:

if @rptNum = 1
begin
Select * FROM tblName

[code]...

View 2 Replies

Web Forms :: Show Same Page In Different Templates, Based Upon A Query String Parameter

Mar 9, 2011

I've a page in ASP.NET, whose appearance can change based upon a given parameter(say query string),

How can I achieve this in ASP.NET, Master pages concept won't work here, as even the contents of the page and positioning of the controls on the page can change based upon the parameter.

One solution I can think of is using XSLT, but is there any other solution I can use to solve this problem? Is there any concept of templates I can use here?

View 1 Replies

Can Set RDL File Parameter Value At Reportviewer Location Page Load

Jul 27, 2010

i have successfully deploy my reports to our SQL reportserver and i was able to display it in a reportviewer in my site. but my problem is my reports is requiring a parameter to display the report, at first the parameterPrompt is were i manually
encode the parameter value, but i need to dynamically pass the parameter value without manually encoding it in the parameterPrompt.

View 3 Replies

Parameter In SqlCommand - Default Zero While End User Load The Data Again

Dec 7, 2010

I have a data entry form. the end user supposed to key in the data as integer. if they do not enter. I do not have default value to put. for the text, I will put the space as default value. Since there will be a lot fields, I really do not like to code as default zero while end user load the data again.

Dim iAAGraduate
As Int16If Len(Me.txtAAG.Text) > 0
Then
iAAGraduate =
CInt(Me.txtAAG.Text)End
If

View 3 Replies

Can Check Rows Returned In A QueryString Parameter Based Entity Framework Query

May 29, 2010

I need to check if any rows are returned in a QueryString here's what I have so far.not sure what code to put to see if the row count is greater than 1

private void BindDataToGrid()
{
//MessageBoardEntities3 is ThemeableAttribute connection string name
int TID = Convert.ToInt32(Request.QueryString["ThreadID"].ToString()); // if Post ID is int
var context = new MessageBoardEntities3();
gvPosts.DataSource = from p in context.Posts
where p.ThreadID == TID
select new { p.Post1, p.PostID };
gvPosts.DataBind();
lblNoPosts.Text = "No posts found for this thread.";
}

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved