473,725 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Global resource file

Hi,

I have noticed that every aspx page that I created (and ascx file) has an
assosiated resource file aspx.resx.
However what I would like to do is have a single global resource file for
the site.
The resources in this global resource file will possibly change quite often,
there I guess this rules out using web.config as every time web.config
alters the application is recompiled, also I am not sure of the possible
consequences of dynamically changing web.config.

I was thinking that I could use the resource file of global asax as a global
resource file however I am unsure of whether that is what this file is for
or if it is exclusivly for global.asax.

I guess my only option is an XML file. I have ruled a database out as a
means to store global resources.
The main resources that I wish to store are strings to signify success or
faliure messages on a website.

cheers

martin


Nov 18 '05 #1
6 2634
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"martin" <ma************ ***@hotmail.com > wrote in message
news:OU******** *****@TK2MSFTNG P11.phx.gbl...
Hi,

I have noticed that every aspx page that I created (and ascx file) has an assosiated resource file aspx.resx.
However what I would like to do is have a single global resource file for
the site.
The resources in this global resource file will possibly change quite often, there I guess this rules out using web.config as every time web.config
alters the application is recompiled, also I am not sure of the possible
consequences of dynamically changing web.config.

I was thinking that I could use the resource file of global asax as a global resource file however I am unsure of whether that is what this file is for
or if it is exclusivly for global.asax.

I guess my only option is an XML file. I have ruled a database out as a
means to store global resources.
The main resources that I wish to store are strings to signify success or
faliure messages on a website.

cheers

martin

Nov 18 '05 #2
Hi Alvin,

No really resolved it.

can uses an xml file to hold all of my strings for error messages

eg
<Errors>
<Key ErrNum="1" value="Must enter a date"/>
<Key ErrNum="2" value="A fatal error occured -- closing program"/>
<Key ErrNum="3" value="An non fatal error ccured"/>
</Errors>

however, I am unsure about concurency issues such as a number of users
accessing the strings at the same time.
No one will ever write to this xml resources file except me.
I don't want me writing to it to ever cause an error, and I don't want
errors to happen when a certain number of users try to read the file.
I especially don't want to hold these values in a database as I will retrive
them often.

I did think about caching the error XML file in memory but it will be quite
large.

any ideas would be appreciated.

cheers

martin.
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:OD******** ******@tk2msftn gp13.phx.gbl...
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"martin" <ma************ ***@hotmail.com > wrote in message
news:OU******** *****@TK2MSFTNG P11.phx.gbl...
Hi,

I have noticed that every aspx page that I created (and ascx file) has
an
assosiated resource file aspx.resx.
However what I would like to do is have a single global resource file

for the site.
The resources in this global resource file will possibly change quite

often,
there I guess this rules out using web.config as every time web.config
alters the application is recompiled, also I am not sure of the possible
consequences of dynamically changing web.config.

I was thinking that I could use the resource file of global asax as a

global
resource file however I am unsure of whether that is what this file is for or if it is exclusivly for global.asax.

I guess my only option is an XML file. I have ruled a database out as a
means to store global resources.
The main resources that I wish to store are strings to signify success or faliure messages on a website.

cheers

martin


Nov 18 '05 #3
when you try to write to the resource file, obtain a write lock on the file.
This will prevent concurrency issues.

lock(filerefere nce)
{
anything inside here is protected
}

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"martin" <ma************ ***@hotmail.com > wrote in message
news:eR******** *****@TK2MSFTNG P12.phx.gbl...
Hi Alvin,

No really resolved it.

can uses an xml file to hold all of my strings for error messages

eg
<Errors>
<Key ErrNum="1" value="Must enter a date"/>
<Key ErrNum="2" value="A fatal error occured -- closing program"/>
<Key ErrNum="3" value="An non fatal error ccured"/>
</Errors>

however, I am unsure about concurency issues such as a number of users
accessing the strings at the same time.
No one will ever write to this xml resources file except me.
I don't want me writing to it to ever cause an error, and I don't want
errors to happen when a certain number of users try to read the file.
I especially don't want to hold these values in a database as I will retrive them often.

I did think about caching the error XML file in memory but it will be quite large.

any ideas would be appreciated.

cheers

martin.
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:OD******** ******@tk2msftn gp13.phx.gbl...
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"martin" <ma************ ***@hotmail.com > wrote in message
news:OU******** *****@TK2MSFTNG P11.phx.gbl...
Hi,

I have noticed that every aspx page that I created (and ascx file) has
an
assosiated resource file aspx.resx.
However what I would like to do is have a single global resource file

for the site.
The resources in this global resource file will possibly change quite

often,
there I guess this rules out using web.config as every time web.config
alters the application is recompiled, also I am not sure of the possible consequences of dynamically changing web.config.

I was thinking that I could use the resource file of global asax as a

global
resource file however I am unsure of whether that is what this file is for or if it is exclusivly for global.asax.

I guess my only option is an XML file. I have ruled a database out as a means to store global resources.
The main resources that I wish to store are strings to signify success or faliure messages on a website.

cheers

martin



Nov 18 '05 #4
Thanks for that Alvin,

I have three questions if I may,

1. Is there a maximum number of users who can access a file at any one time,
I have always been under the impression that even if one user attemps to
access a file when another has it open then there will be a problem.

2. If i have a lock on a file, does it affect other uses who want to read
the file or just other sessions that want to write to the file, I guess I
can specify the type of lock.

3. Is caching the file a good idea and accessing it from memory rather than
accessing the file on disk all the time. I guess I could alway check "does
the value exist in the xml file in the cache" if it does then just read from
the cache otherwise load the file from disk into the cache.

thank for your input.

cheers

martin.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:OF******** ******@TK2MSFTN GP11.phx.gbl...
when you try to write to the resource file, obtain a write lock on the file. This will prevent concurrency issues.

lock(filerefere nce)
{
anything inside here is protected
}

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"martin" <ma************ ***@hotmail.com > wrote in message
news:eR******** *****@TK2MSFTNG P12.phx.gbl...
Hi Alvin,

No really resolved it.

can uses an xml file to hold all of my strings for error messages

eg
<Errors>
<Key ErrNum="1" value="Must enter a date"/>
<Key ErrNum="2" value="A fatal error occured -- closing program"/>
<Key ErrNum="3" value="An non fatal error ccured"/>
</Errors>

however, I am unsure about concurency issues such as a number of users
accessing the strings at the same time.
No one will ever write to this xml resources file except me.
I don't want me writing to it to ever cause an error, and I don't want
errors to happen when a certain number of users try to read the file.
I especially don't want to hold these values in a database as I will retrive
them often.

I did think about caching the error XML file in memory but it will be

quite
large.

any ideas would be appreciated.

cheers

martin.
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:OD******** ******@tk2msftn gp13.phx.gbl...
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"martin" <ma************ ***@hotmail.com > wrote in message
news:OU******** *****@TK2MSFTNG P11.phx.gbl...
> Hi,
>
> I have noticed that every aspx page that I created (and ascx file)
has
an
> assosiated resource file aspx.resx.
> However what I would like to do is have a single global resource
file for
> the site.
> The resources in this global resource file will possibly change
quite often,
> there I guess this rules out using web.config as every time web.config > alters the application is recompiled, also I am not sure of the

possible > consequences of dynamically changing web.config.
>
> I was thinking that I could use the resource file of global asax as a global
> resource file however I am unsure of whether that is what this file
is for
> or if it is exclusivly for global.asax.
>
> I guess my only option is an XML file. I have ruled a database out
as a > means to store global resources.
> The main resources that I wish to store are strings to signify

success or
> faliure messages on a website.
>
> cheers
>
> martin
>
>
>
>



Nov 18 '05 #5
> 1. Is there a maximum number of users who can access a file at any one
time,
I have always been under the impression that even if one user attemps to
access a file when another has it open then there will be a problem. Usually, only one user should be writing to the file at any one point in
time, which is the reason for a lock. In the absence of a lock, multiple
users will be allowed to write to the file with unpredictable results.
2. If i have a lock on a file, does it affect other uses who want to read
the file or just other sessions that want to write to the file, I guess I
can specify the type of lock. It depends on the type of lock. A read lock prevents other users from
reading the file. A write lock prevents other users from writing to the
file. A read/write lock is queue.
3. Is caching the file a good idea and accessing it from memory rather than accessing the file on disk all the time. I guess I could alway check "does
the value exist in the xml file in the cache" if it does then just read from the cache otherwise load the file from disk into the cache. Disk I/O is always very expensive compared to an in-memory access. Weigh
this carefully against the required memory consumption of the file and make
a best judgement of where the file should reside, that is either in memory
or on disk.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"martin" <ma************ ***@hotmail.com > wrote in message
news:um******** *****@TK2MSFTNG P10.phx.gbl... Thanks for that Alvin,

I have three questions if I may,

1. Is there a maximum number of users who can access a file at any one time, I have always been under the impression that even if one user attemps to
access a file when another has it open then there will be a problem.

2. If i have a lock on a file, does it affect other uses who want to read
the file or just other sessions that want to write to the file, I guess I
can specify the type of lock.

3. Is caching the file a good idea and accessing it from memory rather than accessing the file on disk all the time. I guess I could alway check "does
the value exist in the xml file in the cache" if it does then just read from the cache otherwise load the file from disk into the cache.

thank for your input.

cheers

martin.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:OF******** ******@TK2MSFTN GP11.phx.gbl...
when you try to write to the resource file, obtain a write lock on the file.
This will prevent concurrency issues.

lock(filerefere nce)
{
anything inside here is protected
}

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"martin" <ma************ ***@hotmail.com > wrote in message
news:eR******** *****@TK2MSFTNG P12.phx.gbl...
Hi Alvin,

No really resolved it.

can uses an xml file to hold all of my strings for error messages

eg
<Errors>
<Key ErrNum="1" value="Must enter a date"/>
<Key ErrNum="2" value="A fatal error occured -- closing program"/> <Key ErrNum="3" value="An non fatal error ccured"/>
</Errors>

however, I am unsure about concurency issues such as a number of users
accessing the strings at the same time.
No one will ever write to this xml resources file except me.
I don't want me writing to it to ever cause an error, and I don't want
errors to happen when a certain number of users try to read the file.
I especially don't want to hold these values in a database as I will

retrive
them often.

I did think about caching the error XML file in memory but it will be

quite
large.

any ideas would be appreciated.

cheers

martin.
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:OD******** ******@tk2msftn gp13.phx.gbl...
> Your post went unanswered. Have you resolved this issue?
>
> --
> Regards,
> Alvin Bruney [ASP.NET MVP]
> Got tidbits? Get it here...
> http://tinyurl.com/3he3b
> "martin" <ma************ ***@hotmail.com > wrote in message
> news:OU******** *****@TK2MSFTNG P11.phx.gbl...
> > Hi,
> >
> > I have noticed that every aspx page that I created (and ascx file) has
> an
> > assosiated resource file aspx.resx.
> > However what I would like to do is have a single global resource file for
> > the site.
> > The resources in this global resource file will possibly change quite > often,
> > there I guess this rules out using web.config as every time web.config > > alters the application is recompiled, also I am not sure of the

possible
> > consequences of dynamically changing web.config.
> >
> > I was thinking that I could use the resource file of global asax
as a > global
> > resource file however I am unsure of whether that is what this
file
is for
> > or if it is exclusivly for global.asax.
> >
> > I guess my only option is an XML file. I have ruled a database out as
a
> > means to store global resources.
> > The main resources that I wish to store are strings to signify

success or
> > faliure messages on a website.
> >
> > cheers
> >
> > martin
> >
> >
> >
> >
>
>



Nov 18 '05 #6
Hi Alvin,

thanks for all your help,

I will weight the issues you mention up carefully before making a final
decision.

cheers

martin.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:uj******** ******@tk2msftn gp13.phx.gbl...
1. Is there a maximum number of users who can access a file at any one time,
I have always been under the impression that even if one user attemps to
access a file when another has it open then there will be a problem.

Usually, only one user should be writing to the file at any one point in
time, which is the reason for a lock. In the absence of a lock, multiple
users will be allowed to write to the file with unpredictable results.
2. If i have a lock on a file, does it affect other uses who want to read the file or just other sessions that want to write to the file, I guess I can specify the type of lock.

It depends on the type of lock. A read lock prevents other users from
reading the file. A write lock prevents other users from writing to the
file. A read/write lock is queue.
3. Is caching the file a good idea and accessing it from memory rather

than
accessing the file on disk all the time. I guess I could alway check "does the value exist in the xml file in the cache" if it does then just read

from
the cache otherwise load the file from disk into the cache.

Disk I/O is always very expensive compared to an in-memory access. Weigh
this carefully against the required memory consumption of the file and

make a best judgement of where the file should reside, that is either in memory
or on disk.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"martin" <ma************ ***@hotmail.com > wrote in message
news:um******** *****@TK2MSFTNG P10.phx.gbl...
Thanks for that Alvin,

I have three questions if I may,

1. Is there a maximum number of users who can access a file at any one

time,
I have always been under the impression that even if one user attemps to
access a file when another has it open then there will be a problem.

2. If i have a lock on a file, does it affect other uses who want to read the file or just other sessions that want to write to the file, I guess I can specify the type of lock.

3. Is caching the file a good idea and accessing it from memory rather

than
accessing the file on disk all the time. I guess I could alway check "does the value exist in the xml file in the cache" if it does then just read

from
the cache otherwise load the file from disk into the cache.

thank for your input.

cheers

martin.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:OF******** ******@TK2MSFTN GP11.phx.gbl...
when you try to write to the resource file, obtain a write lock on the

file.
This will prevent concurrency issues.

lock(filerefere nce)
{
anything inside here is protected
}

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"martin" <ma************ ***@hotmail.com > wrote in message
news:eR******** *****@TK2MSFTNG P12.phx.gbl...
> Hi Alvin,
>
> No really resolved it.
>
> can uses an xml file to hold all of my strings for error messages
>
> eg
> <Errors>
> <Key ErrNum="1" value="Must enter a date"/>
> <Key ErrNum="2" value="A fatal error occured -- closing

program"/>
> <Key ErrNum="3" value="An non fatal error ccured"/>
> </Errors>
>
> however, I am unsure about concurency issues such as a number of users > accessing the strings at the same time.
> No one will ever write to this xml resources file except me.
> I don't want me writing to it to ever cause an error, and I don't want > errors to happen when a certain number of users try to read the file. > I especially don't want to hold these values in a database as I will
retrive
> them often.
>
> I did think about caching the error XML file in memory but it will be quite
> large.
>
> any ideas would be appreciated.
>
> cheers
>
> martin.
>
>
> "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message > news:OD******** ******@tk2msftn gp13.phx.gbl...
> > Your post went unanswered. Have you resolved this issue?
> >
> > --
> > Regards,
> > Alvin Bruney [ASP.NET MVP]
> > Got tidbits? Get it here...
> > http://tinyurl.com/3he3b
> > "martin" <ma************ ***@hotmail.com > wrote in message
> > news:OU******** *****@TK2MSFTNG P11.phx.gbl...
> > > Hi,
> > >
> > > I have noticed that every aspx page that I created (and ascx

file)
> has
> > an
> > > assosiated resource file aspx.resx.
> > > However what I would like to do is have a single global resource

file
> for
> > > the site.
> > > The resources in this global resource file will possibly change

quite
> > often,
> > > there I guess this rules out using web.config as every time

web.config
> > > alters the application is recompiled, also I am not sure of the
possible
> > > consequences of dynamically changing web.config.
> > >
> > > I was thinking that I could use the resource file of global asax as
a
> > global
> > > resource file however I am unsure of whether that is what this

file
is
> for
> > > or if it is exclusivly for global.asax.
> > >
> > > I guess my only option is an XML file. I have ruled a database

out as
a
> > > means to store global resources.
> > > The main resources that I wish to store are strings to signify

success
> or
> > > faliure messages on a website.
> > >
> > > cheers
> > >
> > > martin
> > >
> > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #7

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

Similar topics

7
6575
by: Matt Calhoon | last post by:
Hi there, How does IIS 6.0 treat the global.asa file? I had the following problem; 1. uploaded a new site to the win3k server 2. had incorrect db connection string in Session_OnStart in global.asa and website caused errors. 3. Changed the global.asa file to include the correct details. Saved the file. Still got the same errors.
5
4203
by: Daves | last post by:
emm... what exactly is the difference?! If I want a global file without <script></script> tags could I use global.ascx only like class Global { void Session_Start(Object sender, EventArgs e) {...} }
4
6978
by: Omega | last post by:
Hi, I have an ImageList and I want to use it at design time in several forms, how can I do it ? Ok, I can copy the ImageList from one form and paste it on the new form, but these ImageLists are then duplicate. Thanks
3
2122
by: Jarmo Muukka | last post by:
Hi all! I have a small problem I cannot find a good solution. The problem is destructing global (static) variables in correct order. I try to mimic it in here. // file1.cpp contains implementation of Class1 static Class1 instance;
37
2744
by: eoindeb | last post by:
Sorry to ask another global variable question, but from reading other posts I'm still not sure whether to use them or not. I have a program with a set function that calls 4 other functions in order - let's say function A, B, C, D. It always calls function A first which is a function that returns a system path. Now all other functions require that variable as well (function A returns a char pointer)
11
8373
by: Ron | last post by:
I have a web project compiled with the new "Web Deployment Projects" plugin for VS2005. I'm deploying the web project to one assembly and with updateable option set to ON. When I'm running the generated code on a W2K3 server the application_start and any other event on the global.asax file won't fire. I added tracing and logging to make sure and I can see the code is just not execution. When running the same exact (deployed etc.) code on...
0
1310
by: vivek | last post by:
localization of lang. using resource files resides in the global resources folder (App_GlobalResources). Currently In my application, I need to have different language resource files in global resources folder, first i select a specific language culture. I need to set static content of controls dynamically using language specific resource file. At the time of execution, I am receiving the error "Could not find any resources...
0
2422
by: klemen.verdnik | last post by:
Hi... I'm having some difficulties getting all possible keys from a specific resource class. Let's say I have a file named: MyProj.TranslationStrings.resx in my App_GlobalResources folder And let's say the .resx file contains two entries: "status.0" with value "Disabled" "status.1" with value "Enabled"
1
282
by: ttt.tas | last post by:
hi all, i'm using asp .net v1.1, when i publish my application on the server using xcopy, i find that the global.asax file is still there, shouldn't it be compiled and assembled?? what if i deleted it, will the assembly files contain any data for event handling tat was in global.asax. i'll also be thankful if anyone can tell me some resource where i can find details for such an issue.
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
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...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8099
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
6702
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
6011
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
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.