Steps to use resource files in Visual Studio.NET

E

Earl Teigrob

I am just trying to get the simplest resource file working using Visual
Studio.NET 2003. Since every aspx file has a .resx file associated with it,
I just added a key called "test" to it and am using the code below to try
and access it. However, I get an error messege executing the program

[Could not find any resources appropriate for the specified culture (or the
neutral culture) in the given assembly. Make sure
"TestCustomControls.WebForm1.aspx.resources" was correctly embedded or
linked into assembly "x6vnwcv5".]

Is my Code Correct?
Did my resource file get compiled?
If not, Can it be compiled from VS.NET 2003?

Thanks for your help

Earl

private void Button1_Click(object sender, System.EventArgs e)

{

ResourceManager rm = new ResourceManager("TestCustomControls.WebForm1.aspx",
this.GetType().Assembly);

Literal1.Text = rm.GetString("test");

}
 
E

Earl Teigrob

I got it...

The Assembly uses on the part before the first period for its resource
name...so this is the corrected code...

ResourceManager rm = new ResourceManager("TestCustomControls.WebForm1",
this.GetType().Assembly);


Earl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top