none
Using Asp.Net 4.5 and getting an error with GetLocalResourceObject RRS feed

  • Question

  • I'm working on a page called default.aspx, which uses a local resource file 
    to populate content(App_LocalResources\default.aspx.resx). On that page is a check box which is working perfectly:

    <asp:CheckBox ID="chkSpecial" runat="server" AutoPostBack="true" CssClass="form-control" Text="<%$ Resources:FullEvent01 %>"  />

    However, when I try to access the descriptions programmatically in the code behind, I'm getting a null error, as with this line:

    strDescription = GetLocalResourceObject("FullEvent01").ToString()

    The specific error is "Object reference not set to an instance of an object." Does anyone have suggestions as to what I'm doing wrong?

    Just to clarify, I'm using ASP.Net 4.5 and Visual Studio 15.8.1. I have not tried to deploy this on the live website yet, so the error is happening strictly on the development site. I've tried creating a new resource file and copied the content from the other into it, but that didn't help. I've rebuilt the site numerous times without any resolution of the issue.

    Thanks in advance for any suggestions, Jorge...

    Tuesday, August 28, 2018 6:02 PM

Answers

All replies