You have local resources and other project local resource. For other local resource, you need to "Add Refference" to your project. and all resources file must set "Access Modifier:" to "Public", You can open Resource FIle, and at the Open Menu above the
open resource you can find menu, one of the menu is "Access Modifier:".
In Web.config at the root folder, you need to add the following code (BOLD):
You have local resources and other project local resource. For other local resource, you need to "Add Refference" to your project. and all resources file must set "Access Modifier:" to "Public", You can open Resource FIle, and at the Open Menu above the
open resource you can find menu, one of the menu is "Access Modifier:".
In Web.config at the root folder, you need to add the following code (BOLD):
Peter Cong
Member
527 Points
681 Posts
The type of namespace name 'Resources' could not be found (are you missing a using directive or a...
Jul 29, 2012 01:26 AM|LINK
Hi , I am new in MVC, this is simple question, please help.
I am followiing this instruction to create that mvc project.
http://afana.me/post/aspnet-mvc-internationalization-part-2.aspx
But on step of: Validation Rules Internationalization, I got this error on this subject.
as Resources is a seperate project file, so in AccoutModels.cs, I have added Resources in my name space as this
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;
using Resources;
....
[Required(ErrorMessageResourceName = "YouMustSpecifyUsername", ErrorMessageResourceType = typeof(Resources.Resources))]
[Display(Name = "ModelUsername", ResourceType = typeof(Resources.Resources))]
public string UserName { get; set; }
.....
As I use Resources.Resources in my code, and I declare the wrong namespace, anybody know how to define the name space in this case?
in my Solution, the project structure is as this:
Solution 'NerdDinner' (2 projects)
NerdDinner this is project file
.
.
Models
AccountModels.cs
Resources - this is project file
Resources.resx
Resources.fr.resx
jsiahaan
Contributor
2304 Points
588 Posts
Re: The type of namespace name 'Resources' could not be found (are you missing a using directive ...
Jul 29, 2012 01:39 AM|LINK
Hi,
You have local resources and other project local resource. For other local resource, you need to "Add Refference" to your project. and all resources file must set "Access Modifier:" to "Public", You can open Resource FIle, and at the Open Menu above the open resource you can find menu, one of the menu is "Access Modifier:".
In Web.config at the root folder, you need to add the following code (BOLD):
<system.web> <globalization culture="auto" uiCulture="auto" />Namespace "Resource" is just a name, it can be any name.
Hope can help
Indonesian Humanitarian Foundation
Peter Cong
Member
527 Points
681 Posts
Re: The type of namespace name 'Resources' could not be found (are you missing a using directive ...
Jul 29, 2012 01:45 AM|LINK
Thank you so much, yes, Add references solves me problem, really appreciative.