472,992 Members | 3,234 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 2560
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*************@TK2MSFTNGP11.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**************@tk2msftngp13.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*************@TK2MSFTNGP11.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(filereference)
{
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*************@TK2MSFTNGP12.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**************@tk2msftngp13.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*************@TK2MSFTNGP11.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**************@TK2MSFTNGP11.phx.gbl...
when you try to write to the resource file, obtain a write lock on the file. This will prevent concurrency issues.

lock(filereference)
{
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*************@TK2MSFTNGP12.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**************@tk2msftngp13.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*************@TK2MSFTNGP11.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*************@TK2MSFTNGP10.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**************@TK2MSFTNGP11.phx.gbl...
when you try to write to the resource file, obtain a write lock on the file.
This will prevent concurrency issues.

lock(filereference)
{
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*************@TK2MSFTNGP12.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**************@tk2msftngp13.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*************@TK2MSFTNGP11.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**************@tk2msftngp13.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*************@TK2MSFTNGP10.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**************@TK2MSFTNGP11.phx.gbl...
when you try to write to the resource file, obtain a write lock on the

file.
This will prevent concurrency issues.

lock(filereference)
{
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*************@TK2MSFTNGP12.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**************@tk2msftngp13.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*************@TK2MSFTNGP11.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
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...
5
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
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...
3
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...
37
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...
11
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...
0
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...
0
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 ...
1
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...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.