How to use Resource.resx file in my soution.
-
Dear Friends, Actually this is my first project in which i create an ASP.net web site i want some global data which i stored in Resource.resx file and i create solution for some business logic now each time i have to pass the Resource.resx file data to solution at any page or button event can it is possible to access the resource file of that web site from the soution itself so it could be centralise at solution level. [Solution (Bussiness Logic)] - [Resource File (Centralise Info)] - [Web page (Front End)] is this a good idea or i thinking something which is not possible. i am using Microsoft Visual Studio 2005 (Framework 2.0) Thanks in advance:cool: Sasmi
-
Dear Friends, Actually this is my first project in which i create an ASP.net web site i want some global data which i stored in Resource.resx file and i create solution for some business logic now each time i have to pass the Resource.resx file data to solution at any page or button event can it is possible to access the resource file of that web site from the soution itself so it could be centralise at solution level. [Solution (Bussiness Logic)] - [Resource File (Centralise Info)] - [Web page (Front End)] is this a good idea or i thinking something which is not possible. i am using Microsoft Visual Studio 2005 (Framework 2.0) Thanks in advance:cool: Sasmi
i dont know how did you store the global data in resx file. As per my knowledge resx file is automatically created for an aspx and it only holds the data of the page. I dont know how to call resx file in the code but i have a suggestion...Dont make the code too complicated..if you want the global data to be stored then create a separate class...while deploying use x copy deployment where you only use dll...hope this will help you...
bzinez
-
Dear Friends, Actually this is my first project in which i create an ASP.net web site i want some global data which i stored in Resource.resx file and i create solution for some business logic now each time i have to pass the Resource.resx file data to solution at any page or button event can it is possible to access the resource file of that web site from the soution itself so it could be centralise at solution level. [Solution (Bussiness Logic)] - [Resource File (Centralise Info)] - [Web page (Front End)] is this a good idea or i thinking something which is not possible. i am using Microsoft Visual Studio 2005 (Framework 2.0) Thanks in advance:cool: Sasmi
It's always a good practice to keep the string values which is common to the application in a assembly resource file. In Framework 2.0, accessing the named strings from assembly resource file has been made very simpler. You have to add the resource file to the
App_GlobalResources
folder and add thenamed strings
to the resource file. Say for an example, you have added a resource file with the nameGlobalData.resx
and a stringApplicationName
with the value "Sample Application". The named strings you add to a global resource file are accessible through a namespace namedResources
. It takes a single line of code...lblAppName.Text = Resources.GlobalData.ApplicationName
- Regards -
J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers