Steps to use resource files in Visual Studio.NET

  • Thread starter Thread starter Earl Teigrob
  • Start date Start date
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");

}
 
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
 
Back
Top