locked
Implicit Localization control binding RRS feed

  • Question

  • User309982698 posted

    hi. i have tried this several times and i cant get it to work with Implicit Localization control binding.

    like this

    Resource file: litTest.Text - some value.... and i get a warning like the resource name "litTest.Text" is not a valid identifyer.


    on my control i do like this:

    <asp:Literal ID="litTest" runat="server" meta:resourcekey="litTest" />


    i dont get the meta as intellisense either.


    anybody got any ideas.


    my example is straight from msdn

    Friday, November 27, 2009 6:33 AM

Answers

  • User309982698 posted

    Doh,  i mixed up the implicit with explicit.. i used the globalresource file and that was the case why it did not work. i changed my aproach to explicit instead.


    <asp:Label id="litTest" runat="server" Text="<%$ Resources:Resource, litTest %>" />


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 27, 2009 8:17 AM

All replies

  • User681263371 posted

    I have used resource files with control binding many a times. Text is a valid property of  a Literal control and placing "litTest.Text" should not create any problem. Also meta:resourcekey wont be available in intellisense as it is a special attribute to specify implicit localization. Did you check whether there is a duplicate key with the same name?

    Friday, November 27, 2009 7:09 AM
  • User309982698 posted

    yes no duplication of it. i dont understand why it wont work tho? i can bind the litTest.Text in codebind, but i dont want to do the xtra work when i can do it with the meta:Resourcekey. i should be able to..

    Friday, November 27, 2009 7:16 AM
  • User681263371 posted

    Did you try cleaning the application and then rebuilding the app? Sometimes most of the problem gets solved just by doing this small thing.

    Friday, November 27, 2009 7:26 AM
  • User309982698 posted

    yes. several times still nothing. is it maby something else i could be missing? i got my class BasePage, my resource files, the literal control, the meta..

    Friday, November 27, 2009 7:43 AM
  • User309982698 posted

    Doh,  i mixed up the implicit with explicit.. i used the globalresource file and that was the case why it did not work. i changed my aproach to explicit instead.


    <asp:Label id="litTest" runat="server" Text="<%$ Resources:Resource, litTest %>" />


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 27, 2009 8:17 AM