views:

19

answers:

1

Hi,

I have the following line of code:

<%= Html.Label((string) GetLocalResourceObject("Label_Email")) %>

This generates a label within an HTML page.

In the local resource file I have the following entry:

Name: Label_Email Value:Email

For some very strange reason when I load the page in the browser, it generates an HTML label with a value of "Email Address" instead of "Email". This is a serious problem for me because I need to localize the application and not have english word "address".

When I replace Value in the local resouce file with "Email " (notice extra space), everything works fine, but this is a hack and I need to understand why my application is behaving this way.

Thank you

+1  A: 

First check if your Label is really read from this resource. to check it, change the Value (to Your name or etc).

Then get sure which the label exactly shows the value. if it doesn't display your value at all then your implemenation is wrong. but it shows the changes value. it should be works fine.

If it doesn't work try this

<asp:label id="Label_Email" runat="server" meta:resourcekey="Label_Email" />

and note that in your resource file youhave to insert

Label_Email.Text = "something"

not

Label_Email = "wrong"

Nasser Hadjloo