473,785 Members | 2,829 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="Descript ion", required="no"
ATTR_3: value="Price", required="yes"
ATTR_4: value="Referenc e", 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:attribut e name="required" type="xsd:strin g" />

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 1675

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

Similar topics

1
5862
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 renamed resource files are not automatically linked to the object they belong by the IDE
4
8599
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
1325
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 named DesktopBanner.ascx (from Portal Starter Kit), I added two files in the same directory using the "application resource
2
829
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 approach would be to have individual resx files for each form/user control. My main problem is having difficulties in naming my resource file. For example, suppose I have a web form called Items.aspx. I want to have a resource file for it and name it...
2
5523
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 base classes. A base class includes this property (among others...;-)):
0
1499
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 its giving error code is as follows string str = Server.MapPath("App_LocalResources/Resource.resx");
8
12091
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 but I'd like to be able to load a file specified in a .resx resource. I've added my .xaml file to the .resx and can load it in using ResourceManager::GetObject(). The object returned is a System::Array^ which contains System::Byte objects. The...
2
1151
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 the italian versions Message.it.resx, Screen.it.resx and FreeText.it.resx and others as well. Since the project is not the startup project, I have used added the dlls files of the resource files as a link to the startup project. The problem is...
8
14949
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 cut and paste code that MSDN recommends for playing a simple wav file from inside an embedded file, like presumeably the 'resources' file .resx is. I want to embed the .wav file in a 'resource file' since I don't want the user storing the file on...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10327
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8973
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.