473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Adding/reading additional attributes to/from Resource files .resx

Hi,

I'm working with .resx files for a multilanguage application and so far it
has worked
perfectly. However, now I want to add more attributes to the xml schema and
read
them at running time. ie: I want to programatically generate forms and
validate
their input fields according to the data stored on a resource file. Here is an
example:

NUM_ATTRS: value="4"
ATTR_1: value="Name", required="yes"
ATTR_2: value="Description", required="no"
ATTR_3: value="Price", required="yes"
ATTR_4: value="Reference", required="yes"

If you see, I need an extra attribute called "required". I modified the xml
source of
my resource file and add the following line to the "data" section:

<xsd:attribute name="required" type="xsd:string" />

Now, I see the extra column when editing the resx file on visual studio .net
and
can set a value to it, but I don't know how to read it. I saw the
documentation of
ResourceManager and there are only two methods to get data from the resource
file: GetString and GetObject; however, they only get the value attribute
and if the
object is an image, then it gets the bitmap itself. I also looked for a
solution in
google, but most of the messages I found doesn't give a solution.

The only way I found was to add an extra string called "ATTR_REQUIRED_n",
where n is a number, and set it to "yes" or "no", but I thing the xml
attributes look
cleaner and more natural. Is possible to do solve this problem with custom xml
attributes? How? Is there perhaps another approach?

Thanks in advanced,
Josef
Nov 17 '05 #1
0 1660

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gabriel Lozano-Morán | last post by:
First of all sorry for the cross-posting but I am not sure wether this belongs under internationalization or just general. Environment: Visual Studio .NET 2003 Problem: Newly added and...
4
by: Mehdi Mousavi | last post by:
Hi, I need to know how to extract a specific icon (32x32 for instance) from an icon file that contains more than one icon size? Any help would be highly appreciated, Cheers. Mehdi
0
by: Steve B. | last post by:
Hi all, I'm looking for a pretty way to globalize an ASP.Net application. I base on the Globalization Architecture for ASP.NET article from the MSDN Library. If I have a user control...
2
by: JollyK | last post by:
Hello friends, In a large asp.net project, I don't think it is a good idea for having one common resource file containing all localized strings for the whole application. I think a better...
2
by: Fredrik Rodin | last post by:
All, I'm having problems with my resource manager in ASP.NET 2.0 after conversion from ASP.NET 1.1. Here is a background: In ASP.NET 1.1 All my user controls and aspx pages inherit from...
0
by: Bhavini | last post by:
Hi all, I have to implement localization in asp.net application using .resx files, but I have to read and modify these .resx files at runtime, I used ResourceReader class to read that file but...
8
by: John Dunn | last post by:
Since currently we aren't allowed to have compiled XAML files embedded in C++ apps I'm using Markup::XamlReader::Load to dynamically load XAML files. This works perfectly fine with external files...
2
by: moiashvin | last post by:
I have a c# solution, with a couple of projects. In one project, I got a folder named Resources, and inside I have a couple of resource files, including Message.resx, Screen.resx, FreeText.resx and...
8
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the Express version, which does not. I am trying to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.