Resource file dose not exist in the current context

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
11/23/2010 9:46:04 AM
Gravatar
Total Posts 22

Resource file dose not exist in the current context

Hi,

Im trying to localise a button using the resource file using the following code

button.text = resourcefile.submit;

where submit is an entry in the resourcefile. However the resource file dose not exist in the current context. It is in the same project as the module im creating.

As far as I can see I have all my references are set correctly. Am i missing something really stupid.

Thanks for you help in advance

11/25/2010 8:00:01 AM
Gravatar
Total Posts 18439

Re: Resource file dose not exist in the current context

do you have this:

using Resources;

if you don't have that then you would need button.Text = Resources.resourcefile.submit;

12/3/2010 10:05:40 AM
Gravatar
Total Posts 22

Re: Resource file dose not exist in the current context

Thanks Joe,

Ye I have 'using Resources' but intelisense dose not give me the resource file when i start typing. The resource file is in App_GlobalResources folder in the custom project.

When I tried Resources.resourcefile.submit I still get the same error  Error 1 The type or namespace name 'resourcefile' does not exist in the namespace 'Resources' (are you missing an assembly reference?)

Do I need to add a reference to the custom project?

 

12/3/2010 10:30:05 AM
Gravatar
Total Posts 18439

Re: Resource file dose not exist in the current context

Are you using Visual Studio 2010 or Visual Web Developer Express 2010? 

People have reported issues with resource files in Visual Web Developer Express on this thread, I posted workaround that worked for me, but it is much better if you have VS 2010. If you don't have VS 2010, you may qualify to get it free in the Web Site Spark program from Microsoft.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.