Last post Nov 20, 2012 04:44 AM by Danielj86
Mar 27, 2007 10:19 AM|arunmanglick|LINK
See the below code:
1 ResXResourceWriter rw =
3 rw.AddResource("IntegerData", 2);
In my ASP,NET Web Portal, I am using the above code to do the 'Translation' functionality. Actually the need is allow a Administrator to define the translation of the Web-Pages for the various languages at runtime.
This all is happening at the run time.
But the probelm is once the system saves the file after writing, it clears the Session, Cache and Application state. Clearing these State objects definietly leads to halt in the Web-Application and ultimately throws the flow of control
to Login page.
i.e. It is behaving the way we encounter, after wriiting into Web.config / Global.asax at runtime.
Please help asap.
Mar 28, 2007 12:58 AM|vivek_iit|LINK
Any changes made to resource files or files under /bin folder will lead to an application restart clearing your session/application variables. This restart is actually neccessary because the ASP.NET runtime needs to load the new/modified values fromthe changed
files and clear its old cache (for e.g. it caches the resource files values to avoid multiple reads to the files).
As far as I know you cannot avoid this if you are changing the files at runtime. What you can do is to use Database instead of resource files for this runtime "translation".
Hope this helps,
Mar 28, 2007 03:15 AM|arunmanglick|LINK
Thanks Vivek. I understand the root cause, but still looking for some Trick.
Mar 17, 2010 05:03 PM|savas_murat|LINK
Did you find a trick to that? I am having the same issue.
Nov 20, 2012 04:44 AM|Danielj86|LINK
Make sure Resources.resx is not read-only